help core data tableview not reloading
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.
精彩评论