0

I'm using a PFQueryTableViewController from Parse.

I'm using a segmented control to retrieve two types of items from the database. Depending on which segmented button is selected, it retrieves one type or the other and reloads the same tableView. The problem is that when I am loading one type and then I switch to the other while the first is still loading, the tableView populates with items of the first type. Any way to cancel a tableView data retrieval?

Adil Soomro
  • 37,609
  • 9
  • 103
  • 153
Ryan Bobrowski
  • 2,641
  • 3
  • 31
  • 52

1 Answers1

1

The PFQueryTableViewController's data retrieval is handled by overriding queryForTable, you should be able to call cancel just as you would on any other query.

Alternatively, it is very easy to build your own table view controller which populates it's data source using Parse. Using this, you could maintain two separate query result containers to avoid conflicts between the two segments.

Here's another post which will show you how you could go about creating your own table view controller.

Russell
  • 3,099
  • 2
  • 14
  • 18