基本上我想做的是在 CoreData 元素(下一个/上一个)之间切换。这是我到目前为止尝试过的,但它不起作用。
-(void)plus
{
UINavigationController *navController = (UINavigationController *)self.window.rootViewController;
RootView *controller = (RootView *)navController.topViewController;
controller.managedObjectContext =selectedPerson.managedObjectContext;
NSIndexPath *indexPath = [controller.tableView indexPathForSelectedRow];
NSIndexPath* newIndexPath = [NSIndexPath indexPathForRow:indexPath.row+1 inSection:indexPath.section];
controller.selectedNote = [controller.fetchedResultsController objectAtIndexPath:newIndexPath];
self.selectedPerson = controller.selectedNote;
self.title = self.selectedPerson.name;
}
有什么建议么?