0

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");
     }
}];
5
  • 2
    Welcome to StackOverflow. You're solving the wrong problem. You should instead work towards solving your app's crash. Don't bypass PFQueryTableViewController. Commented Jul 26, 2014 at 16:39
  • Yeah, you should resolve the crash. What's the error? How are you going about deleting the row? Commented Jul 26, 2014 at 16:52
  • which part of your current implementation is not behaving as expected when using UIViewController? Commented Jul 26, 2014 at 16:58
  • Did you drag a UIViewController onto the storyboard instead of a UITableViewController? A PFQueryTableViewController cannot be a UIViewController. Commented Jul 26, 2014 at 17:57
  • Oh! i see. Easy to miss. Thanks to you, Jacob and others too. Commented Jul 28, 2014 at 14:19

2 Answers 2

1

I suggest u use: PFQueryTableViewController and figure out why your app is crashing. Also, ur code looks good to delete a row.

Sign up to request clarification or add additional context in comments.

Comments

0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.