简体   繁体   中英

tableView will crash when reload data

After I call method getData. I try reload data but it didn't reload data. I don't know why but I can get Data correctly. Oh I set getData at viewDidAppear because I want to get in this view from prev view quickly and User will see loading view and when I completely load data , loading view will disappear and tableview will appear

Here is my simple code

.m

- (void) viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
    [self getData];
    NSLog(@"%@ %@ %@ %@",con_ad,con_po,depre,other);
    [tableCommon reloadData];
    [bckView removeFromSuperview];
}

.h

@interface Hoora : UIViewController {
    IBOutlet UITableView *tableCommon;
}

@property (nonatomic, retain) UITableView *tableCommon;

I already link Ref. Outlet.

It said it crash at main.m How can I set cell in new data.

I'm sorry. It just show EXE-BAD-ACCESS error

another possibility is that your custom cells and/or data source are released. Then the reload TableView method want to access the cells/data source but couldn't get the data -> crash

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM