Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Hi I was out of this way. Fetched result controller have to do this work for u. Just connect u BOOL core data state to u uiswitch and make something like:</p> <pre><code>- (void)controller:(NSFetchedResultsController *)controller didChangeObject:(id)anObject atIndexPath:(NSIndexPath *)indexPath forChangeType:(NSFetchedResultsChangeType)type newIndexPath:(NSIndexPath *)newIndexPath { UITableView *tableView = self.tableView; [tableView beginUpdates]; switch(type) { case NSFetchedResultsChangeInsert: { NSIndexPath *newIndex = [NSIndexPath indexPathForRow:newIndexPath.row inSection:2]; [tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:newIndex] withRowAnimation:UITableViewRowAnimationFade]; break; } case NSFetchedResultsChangeDelete: { NSIndexPath *newIndex = [NSIndexPath indexPathForRow:indexPath.row inSection:2]; [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:newIndex] withRowAnimation:UITableViewRowAnimationFade]; break; } case NSFetchedResultsChangeUpdate: { NSIndexPath *newIndex = [NSIndexPath indexPathForRow:indexPath.row inSection:2]; [self configureCell:(CompanyAndUserInfoCell *)[tableView cellForRowAtIndexPath:newIndex] atIndexPath:newIndex forTableView:tableView]; break; } case NSFetchedResultsChangeMove: { NSIndexPath *newIndexStart = [NSIndexPath indexPathForRow:indexPath.row inSection:2]; NSIndexPath *newIndexStop = [NSIndexPath indexPathForRow:newIndexPath.row inSection:2]; [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:newIndexStart] withRowAnimation:UITableViewRowAnimationFade]; [tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:newIndexStop] withRowAnimation:UITableViewRowAnimationFade]; break; } } [tableView endUpdates]; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload