tableview not reloading using reloadData

我怕爱的太早我们不能终老 提交于 2020-01-06 12:47:43

问题


On load i show my table with one cell showing "Loading...", using threading, in the background im obtaining my rss and adding it to my sqlite table. The method (updatedDbWithRSSfeed) callied via performSelectorOnMainThread:@selector(updatedDbWithRSSfeed:) is not in the same class thats holding the uitableview (which is in FeedsView). So in updatedDbWithRSSfeed after updating my sqlite table, im calling the the relevant class (FeedsView) to reload uitableView (reloadMyData), but does not seem to reload the data and numberOfRowsInSection doesnt seem to be called so i can resize my table. Any ideas why this may be happening, am I going about this the wrong way?

rootViewcontroller.m

-(void)updatedDbWithRSSfeed:(NSMutableArray*)items {

/* inserting data into table here */

FeedsView *feedview = [[FeedsView alloc]init];  
[feedview reloadMyData];
[feedview release];

}

FeedsView.m

-(void) reloadMyData {
/* reading latest entries from db table and updating my dataSource (feedTableDS)*/
[self.feedTableDS reloadData];
}

来源:https://stackoverflow.com/questions/5297293/tableview-not-reloading-using-reloaddata

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!