Inherits from UITableViewController
Conforms to PF_EGORefreshTableHeaderDelegate
UITableViewDataSource
UITableViewDelegate
Declared in PFQueryTableViewController.h

Tasks

Creating a PFQueryTableViewController

Configuring Behavior

Responding to Events

  • – objectsDidLoad:

    Called when objects have loaded from Parse. If you override this method, you must
    call [super objectsDidLoad:] in your implementation.

  • – objectsWillLoad

    Called when objects will loaded from Parse. If you override this method, you must
    call [super objectsWillLoad] in your implementation.

Accessing Results

  •   objects

    The array of PFObjects that is the UITableView data source

    property
  • – objectAtIndexPath:

    Returns an object at a particular indexPath. The default impementation returns
    the object at indexPath.row. If you want to return objects in a different
    indexPath order, like for sections, override this method.

Querying

Data Source Methods

Properties

imageKey

The key to use to display for the cell image view. This won’t apply if you override tableView:cellForRowAtIndexPath:object:

@property (nonatomic, retain) NSString *imageKey

Discussion

The key to use to display for the cell image view. This won’t apply if you override tableView:cellForRowAtIndexPath:object:

Declared In

PFQueryTableViewController.h

isLoading

Whether the table is actively loading new data from the server

@property (nonatomic, assign) BOOL isLoading

Discussion

Whether the table is actively loading new data from the server

Declared In

PFQueryTableViewController.h

loadingViewEnabled

Whether the table should use the default loading view (default:YES)

@property (nonatomic, assign) BOOL loadingViewEnabled

Discussion

Whether the table should use the default loading view (default:YES)

Declared In

PFQueryTableViewController.h

objects

The array of PFObjects that is the UITableView data source

@property (nonatomic, retain, readonly) NSArray *objects

Discussion

The array of PFObjects that is the UITableView data source

Declared In

PFQueryTableViewController.h

objectsPerPage

The number of objects to show per page (default: 25)

@property (nonatomic, assign) NSUInteger objectsPerPage

Discussion

The number of objects to show per page (default: 25)

Declared In

PFQueryTableViewController.h

paginationEnabled

Whether the table should use the built-in pagination feature (default:YES)

@property (nonatomic, assign) BOOL paginationEnabled

Discussion

Whether the table should use the built-in pagination feature (default:YES)

Declared In

PFQueryTableViewController.h

parseClassName

The class of the PFObject this table will use as a datasource

@property (nonatomic, retain) NSString *parseClassName

Discussion

The class of the PFObject this table will use as a datasource

Declared In

PFQueryTableViewController.h

placeholderImage

The image to use as a placeholder for the cell images. This won’t apply if you override tableView:cellForRowAtIndexPath:object:

@property (nonatomic, retain) UIImage *placeholderImage

Discussion

The image to use as a placeholder for the cell images. This won’t apply if you override tableView:cellForRowAtIndexPath:object:

Declared In

PFQueryTableViewController.h

pullToRefreshEnabled

Whether the table should use the built-in pull-to-refresh feature (default:YES)

@property (nonatomic, assign) BOOL pullToRefreshEnabled

Discussion

Whether the table should use the built-in pull-to-refresh feature (default:YES)

Declared In

PFQueryTableViewController.h

textKey

The key to use to display for the cell text label. This won’t apply if you override tableView:cellForRowAtIndexPath:object:

@property (nonatomic, retain) NSString *textKey

Discussion

The key to use to display for the cell text label. This won’t apply if you override tableView:cellForRowAtIndexPath:object:

Declared In

PFQueryTableViewController.h

Instance Methods

clear

Clears the table of all objects.

- (void)clear

Discussion

Clears the table of all objects.

Declared In

PFQueryTableViewController.h

initWithClassName:

Initializes with a class name of the PFObjects that will be associated with this table.

- (id)initWithClassName:(NSString *)aClassName

Parameters

aClassName

The class name of the PFObjects that this table will display

Return Value

The initialized PFQueryTableViewController

Discussion

Initializes with a class name of the PFObjects that will be associated with this table.

Declared In

PFQueryTableViewController.h

initWithStyle:className:

The designated initializer.
Initializes with a class name of the PFObjects that will be associated with this table.

- (id)initWithStyle:(UITableViewStyle)style className:(NSString *)aClassName

Parameters

style

The UITableViewStyle for the table

aClassName

The class name of the PFObjects that this table will display

Return Value

The initialized PFQueryTableViewController

Discussion

The designated initializer.
Initializes with a class name of the PFObjects that will be associated with this table.

Declared In

PFQueryTableViewController.h

loadNextPage

Loads the next page of objects, appends to table, and refreshes.

- (void)loadNextPage

Discussion

Loads the next page of objects, appends to table, and refreshes.

Declared In

PFQueryTableViewController.h

loadObjects

Clears the table and loads the first page of objects.

- (void)loadObjects

Discussion

Clears the table and loads the first page of objects.

Declared In

PFQueryTableViewController.h

loadObjects:clear:

Loads the objects of the className at the specified page and appends it to the
objects already loaded and refreshes the table.

- (void)loadObjects:(NSInteger)page clear:(BOOL)clear

Parameters

page

The page of objects to load.

clear

Whether to clear the table after receiving the objects.

Discussion

Loads the objects of the className at the specified page and appends it to the
objects already loaded and refreshes the table.

Declared In

PFQueryTableViewController.h

objectAtIndexPath:

Returns an object at a particular indexPath. The default impementation returns
the object at indexPath.row. If you want to return objects in a different
indexPath order, like for sections, override this method.

- (PFObject *)objectAtIndexPath:(NSIndexPath *)indexPath

Parameters

indexPath

The indexPath

Return Value

The object at the specified index

Discussion

Returns an object at a particular indexPath. The default impementation returns
the object at indexPath.row. If you want to return objects in a different
indexPath order, like for sections, override this method.

Declared In

PFQueryTableViewController.h

objectsDidLoad:

Called when objects have loaded from Parse. If you override this method, you must
call [super objectsDidLoad:] in your implementation.

- (void)objectsDidLoad:(NSError *)error

Parameters

error

The Parse error from running the PFQuery, if there was any.

Discussion

Called when objects have loaded from Parse. If you override this method, you must
call [super objectsDidLoad:] in your implementation.

Declared In

PFQueryTableViewController.h

objectsWillLoad

Called when objects will loaded from Parse. If you override this method, you must
call [super objectsWillLoad] in your implementation.

- (void)objectsWillLoad

Discussion

Called when objects will loaded from Parse. If you override this method, you must
call [super objectsWillLoad] in your implementation.

Declared In

PFQueryTableViewController.h

queryForTable

Override to construct your own custom PFQuery to get the objects.

- (PFQuery *)queryForTable

Return Value

PFQuery that loadObjects will use to the objects for this table.

Discussion

Override to construct your own custom PFQuery to get the objects.

Declared In

PFQueryTableViewController.h

tableView:cellForNextPageAtIndexPath:

Override this method to customize the cell that allows the user to load the
next page when pagination is turned on.

- (PFTableViewCell *)tableView:(UITableView *)tableView cellForNextPageAtIndexPath:(NSIndexPath *)indexPath

Parameters

tableView

The table view object associated with this controller.

indexPath

The indexPath of the cell.

Return Value

The cell that allows the user to paginate.

Discussion

Override this method to customize the cell that allows the user to load the
next page when pagination is turned on.

Declared In

PFQueryTableViewController.h

tableView:cellForRowAtIndexPath:object:

Override this method to customize each cell given a PFObject that is loaded. If you
don’t override this method, it will use a default style cell and display either
the first data key from the object, or it will display the key as specified
with keyToDisplay.

- (PFTableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath object:(PFObject *)object

Parameters

tableView

The table view object associated with this controller.

indexPath

The indexPath of the cell.

object

The PFObject that is associated with the cell.

Return Value

The cell that represents this object.

Discussion

Override this method to customize each cell given a PFObject that is loaded. If you
don’t override this method, it will use a default style cell and display either
the first data key from the object, or it will display the key as specified
with keyToDisplay.

The cell should inherit from PFTableViewCell which is a subclass of UITableViewCell.

Declared In

PFQueryTableViewController.h