Note that there are some explanatory texts on larger screens.

plurals
  1. POUITableViewController table won't refresh after deletion, but will refresh on viewWillAppear
    primarykey
    data
    text
    <p>I have a button for each cell, and once clicked it deletes each individual object from the Parse backend. I have it set to <code>reloadData</code> upon success in the block as seen here:</p> <pre><code>- (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; PFRelation *relation = [self.currentUser relationforKey:@"watching"]; [[relation query] findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) { if (error) { // There was an error } else { // NSLog(@"%@", objects); self.watchingEvents = objects; [self refreshTableView]; } }]; } -(IBAction) deleteButtonAction:(id) sender { [SVProgressHUD showWithStatus:@"Removing from Watch List..."]; PFRelation *relation = [self.currentUser relationforKey:@"watching"]; [relation removeObject:self.selectedEvent]; [self.currentUser saveInBackgroundWithBlock:^(BOOL succeeded, NSError *error) { if (error) { NSString *errorString = [[error userInfo] objectForKey:@"error"]; UIAlertView *errorAlertView = [[UIAlertView alloc] initWithTitle:@"Error" message:errorString delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; [errorAlertView show]; } else { [SVProgressHUD showSuccessWithStatus:@"Removed from Watch List!"]; [self refreshTableView]; } }]; } -(void)refreshTableView { [self.tableView reloadData]; } </code></pre> <p>But it doesn't seem to update the tableView, the cell still shows up (even though it's gone because if I navigate away and open the view again the <code>viewWillAppear</code> gets called with the same <code>reloadData</code> function and the items gone like how it should be. So I know the functions working, since it's clearly working in <code>viewWillAppear</code>. Not sure why it's not working once the success of the block is run, as the alert runs fine as does any NSLog message I put in?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload