开发者

reloadTable does nothing

开发者 https://www.devze.com 2023-02-24 02:39 出处:网络
i have a strange problem. I have a tableview and a button where i switch to a modal view. After dismissing the modal view, the tableview shall be reloaded.

i have a strange problem. I have a tableview and a button where i switch to a modal view. After dismissing the modal view, the tableview shall be reloaded.

For testing i just made a button that calls [tableview reloadData]. But nothing happens... And there is new data to be displayed.

Any tips would be nice !

My header:

@interface MainViewController : UIViewController   UITableViewDelegate,UITableViewDataSource,UIPopoverControllerDelegate>
{

    UITableView *_tableView;
    UIPop开发者_C百科overController *popoverController;
}
@property(nonatomic, retain) IBOutlet UITableView *tableView;

My m file:

 @synthesize tableView = _tableView;

-(void) reload: (id) sender 
{     
    [_tableView reloadData];  
    NSLog(@"reloadData");
}


Well, i solved the problem. In the modal view i save data to coreData. But i only read the data in the init function of my tableViewController!! Now i have the readData function included in viewWillAppear and all works great. [tableview reloadData] just had no new data to display.

0

精彩评论

暂无评论...
验证码 换一张
取 消