Advertisement
Guest User

Untitled

a guest
Apr 1st, 2015
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  2. {
  3. debugMethod();
  4. self.WeiboStatusesDatabaseContext = [self createMainQueueManagedObjectContext];
  5. return YES;
  6. }
  7.  
  8. - (void)setWeiboStatusesDatabaseContext:(NSManagedObjectContext *)WeiboStatusesDatabaseContext
  9. {
  10. debugMethod();
  11. _WeiboStatusesDatabaseContext = WeiboStatusesDatabaseContext;
  12. NSDictionary *userInfo = self.WeiboStatusesDatabaseContext ? @{WeiboSTATUSESDatabaseAvailabilityContext : self.WeiboStatusesDatabaseContext} : nil;
  13. [[NSNotificationCenter defaultCenter] postNotificationName:WeiboSTATUSESDatabaseAvailabilityNotification
  14. object:self
  15. userInfo:userInfo];
  16.  
  17. - (void)awakeFromNib
  18. {
  19. debugMethod();
  20. [[NSNotificationCenter defaultCenter] addObserverForName:WeiboSTATUSESDatabaseAvailabilityNotification
  21. object:nil
  22. queue:nil
  23. usingBlock:^(NSNotification *note) {
  24. self.managedObjectContext = note.userInfo[WeiboSTATUSESDatabaseAvailabilityContext];
  25. debugLog(@"context = %@", self.managedObjectContext);
  26. }];
  27. debugLog(@"Context = %@", self.managedObjectContext);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement