Search Results

Search found 2 results on 1 pages for 'iamsmug'.

Page 1/1 | 1 

  • Tab bar application with UINavigation Controller MOC not being retained.

    - by iamsmug
    I created a tab bar application from the template and added a navigation controller to one of the tabs. I have already created this app from the navigation app template already and is working. The reason I am doing it this way is because I need to add a tab bar and thought it would be easier starting by using the tab bar project template and adding the nav controller to it rather than the other way round. I have copied the data model over from the other project and added the relevant code to where it should be. The problem I am having is passing the moc from the app delegate to the tab with the nav controller on. Here is a snippet from my applicationDidFinishLaunching method in my app delegate: - (void)applicationDidFinishLaunching:(UIApplication *)application { [self createEditableCopyOfDatabaseIfNeeded]; Top_BananaTableViewController *top_BananaTableViewController = (Top_BananaTableViewController *)[navigationController topViewController]; top_BananaTableViewController.managedObjectContext = self.managedObjectContext; // Add the tab bar controller's current view as a subview of the window [window addSubview:tabBarController.view]; [window makeKeyAndVisible]; } Everything seems fine here but when it comes to the fetchedResultsController on my nav controller view it bombs out with: '+entityForName: could not locate an NSManagedObjectModel for entity name 'cards'' When I checked what was set to my managedObjectContext on that view it was null. I don't know why or where it is loosing it's setting. Please help.

    Read the article

  • unrecognized selector sent to instance

    - by iamsmug
    My app works fine in the simulator but when I run it on my phone I get this error: 2010-04-05 21:32:45.119 Top Banana[119:207] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[MethodViewController setReferringObject:]: unrecognized selector sent to instance 0x16e930' It happens here: -(void)method { [UIView beginAnimations:@"View Flip" context:nil]; [UIView setAnimationDuration:0.50]; [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; [UIView setAnimationTransition: UIViewAnimationTransitionFlipFromRight forView:self.navigationController.view cache:NO]; MethodViewController *methodViewController = [[MethodViewController alloc] initWithNibName:@"MethodViewController" bundle:0]; NSManagedObject *selectedObject = self.referringObject; methodViewController.referringObject = selectedObject; [self.navigationController pushViewController:methodViewController animated:NO]; methodViewController.title = @"Method"; [UIView commitAnimations]; [MethodViewController release]; } It crashes on this line: methodViewController.referringObject = selectedObject; Not sure how to resolve this as it works in the simulator, I'm sure it is fairly basic to fix, any help will be appreciated.

    Read the article

1