reload tableview in masterviewcontroller when make changes in detailsviewcontroller

StackOverflow https://stackoverflow.com/questions/10913338

  •  13-06-2021
  •  | 
  •  

سؤال

I'm playing with split view and want to reload the table in master view when I make some changes in detail view.

I do a callback to masterview to reload data:

in detailview:

- (void) doneEditSite {
    [popCtrl dismissPopoverAnimated:YES];
    [editSiteVC release];
    [self.tableView reloadData];
    masterVC *tableList = [[masterVC alloc] init];
    [tableList refreshMV:nil];
    [tableList release];
}

in masterVC:

- (void) refreshMV:(id)sender {
    [self getAllMySite:nil];
    [self.tableView reloadData];
}

the numberOfSectionsInTableView and numberOfRowsInSection are called (I've checked it with a NSLog) but the cellForRowAtIndexPath is never called.

What I'm missing?

Thanks, Max

هل كانت مفيدة؟

المحلول

You should not alloc/init an new master view but get a reference to existing one.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top