user3835966
user3835966

Reputation: 3

(Xcode) Parse. How can I delete a row in the table WITHOUT using PFQueryTableViewController

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

Answers (2)

user2510216
user2510216

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

Jacob
Jacob

Reputation: 2338

Did you drag a UIViewController onto the storyboard instead of a UITableViewController? A PFQueryTableViewController cannot be a UIViewController.

Upvotes: 0

Related Questions