开发者

help core data tableview not reloading

开发者 https://www.devze.com 2022-12-23 20:00 出处:网络
i am using core data...my table view does not reload say if i add a new row to the table. until i terminate the app and re open it..开发者_Python百科.im calling reloadData in my root controller viewwi

i am using core data...my table view does not reload say if i add a new row to the table. until i terminate the app and re open it..开发者_Python百科.im calling reloadData in my root controller viewwillappear method... any help would be appreciated

thanks in advance


I am guessing you are using a NSFetchedResultsController? If you are not then you need to be with a UITableView. Once you do, make sure you have your UITableViewDatasource configured as the delegate to the NSFetchedResultsController. Once you do that, you will not need to call -reloadData at all because the NSFetchedResultsController will monitor changes in the NSManagedObjectContext and update the UITableViewDatasource as needed via the delegate methods.

0

精彩评论

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