Reputation: 3
I'm working in Xcode, and since I'm using Parse, I want to delete a row in the table without using PFQueryTableViewController
because when I change UIViewController
to PFQueryTableViewController
, my app crashes.
Here is my code:
PFObject *object = [self.datasource objectAtIndex:IndexPath.row];
// Remove the row from data model
[object deleteInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {
if (succeeded){
[self refresh]; // this is my function to refresh the data
} else {
NSLog(@"DELETE ERROR");
}
}];
Upvotes: 0
Views: 317
Reputation: 53
I suggest u use: PFQueryTableViewController and figure out why your app is crashing. Also, ur code looks good to delete a row.
Upvotes: 1
Reputation: 2338
Did you drag a UIViewController onto the storyboard instead of a UITableViewController? A PFQueryTableViewController cannot be a UIViewController.
Upvotes: 0