Customization: UITableView with FRC. Strings are a simple list of text content that a user can download to update it.
I see strange behavior when cellForRow is called for each row several times. Therefore, I see this at 0.0 0.1 0.2 0.3 (visible lines), but these 4 lines have cellForRow called several times. But when you first view the list, they are called once. Second time, two times, etc. By the 7th time, after the user sees the contents, behind the scenes, he continues to try to tune the cell again and again and eventually crashes.
So, if you go to any list of content, it goes to the server, downloads stories, creates NSMOs and displays. In the logs, I see configureCell once for each visible line. If I update, I see the same thing. BUT, if I go to another screen and then come back when I pull out to refresh, I noticed that cellforrow is called twice for each row. If I continue this process of leaving and returning, every time I do this, the cell solution is called extra time. By running some of the results manager delegation methods, I see that willchangecontent before each set of cellforrow calls. Can someone help me determine why my cellforrow method is being called more and more?
One idea was how I set up FRC. I followed the code like CoreDataBooks, and moved things to viewdidload, but still saw the problem.
I have a property in .h and in .m there is what I considered a standard setting:
- (NSFetchedResultsController *)fetchedResultsController { //NSLog(@"fetchedresulscontroller"); if (_fetchedResultsController != nil) { return _fetchedResultsController; } // initialize fetch request. setup predicate, sort, etc. NSFetchedResultsController *aFetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest managedObjectContext:self.managedObjectContext sectionNameKeyPath:@"date" cacheName:nil]; aFetchedResultsController.delegate = self; self.fetchedResultsController = aFetchedResultsController; // perform actual fetch. delegate methods take it from here NSError *fetchError = nil; if (![self.fetchedResultsController performFetch:&fetchError]) { // Replace this implementation with code to handle the error appropriately. // abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. NSLog(@"Unresolved error %@, %@", fetchError, [fetchError userInfo]); abort(); } return _fetchedResultsController; }