Advertisement
RRK

Untitled

RRK
Nov 30th, 2012
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. I am opening ViewController when the local notification pops up and user clicks on it.
  2.  
  3. appDelegate.m
  4. - (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification {
  5.    
  6.     ViewController *test = [[ViewController alloc]initWithNibName:@"ViewController" bundle:nil];
  7.     test.managedObjectContext = self.managedObjectContext;
  8.     [_navigationController presentModalViewController:test animated:YES];    
  9. }
  10.  
  11. Viewcontroller.h
  12.  
  13. @interface ViewController : UIViewController
  14. {
  15.   Folder *folder;
  16.   NSManagedObjectContext *managedObjectContext;
  17. }
  18. @property (nonatomic, strong) Folder *folder;
  19. @property (nonatomic, strong) NSManagedObjectContext *managedObjectContext;
  20.  
  21. ViewController.m
  22.  
  23. - (void)ViewDidLoad
  24. {
  25.      NSMutableArray *m_notes = [self.folder.task mutableCopy];
  26.          NSLog(@"%i",[m_notes count]);
  27.  
  28.     this shows zero
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement