Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- I am opening ViewController when the local notification pops up and user clicks on it.
- appDelegate.m
- - (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification {
- ViewController *test = [[ViewController alloc]initWithNibName:@"ViewController" bundle:nil];
- test.managedObjectContext = self.managedObjectContext;
- [_navigationController presentModalViewController:test animated:YES];
- }
- Viewcontroller.h
- @interface ViewController : UIViewController
- {
- Folder *folder;
- NSManagedObjectContext *managedObjectContext;
- }
- @property (nonatomic, strong) Folder *folder;
- @property (nonatomic, strong) NSManagedObjectContext *managedObjectContext;
- ViewController.m
- - (void)ViewDidLoad
- {
- NSMutableArray *m_notes = [self.folder.task mutableCopy];
- NSLog(@"%i",[m_notes count]);
- this shows zero
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement