I currently have an NSManagedObjectContext containing 5 Video Objects displayed in a table view.
When a user selects a row, I'm going to push in a new view controller to display object details, and give the user the option to 'add Video to favorites'.
To do this, I want to create a new NSManagedObjectContext, assign the selected Video to it, and push it to the new view controller.
Can someone please explain how I can do this?
My existing code looks something like:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
VideoDetails *vd = [[VideoDetails alloc] initWithStyle:UITableViewStyleGrouped];
vd.video = [videoArray objectAtIndex:indexPath.row];
[[self navigationController] pushViewController:vd animated:YES];
}