code_junkie

iPhone app in the background

Nov 13th, 2011
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. id localNotif = [[NSClassFromString(@"UILocalNotification") alloc] init];
  2. if (!localNotif) {
  3. return;
  4. }
  5.  
  6.  
  7. [localNotif setTimeZone:[NSTimeZone defaultTimeZone]];
  8. [localNotif setAlertBody:NSLocalizedString(@"Hello!",nil)];
  9. [localNotif setAlertAction:NSLocalizedString(@"Hello", nil)];
  10. [localNotif setSoundName:UILocalNotificationDefaultSoundName];
  11. [localNotif setFireDate:[[NSDate date] addTimeInterval:(60*60)]];
  12. [localNotif setFireDate:[[NSDate date] addTimeInterval:(24*60*60)]];
  13. [[UIApplication sharedApplication] scheduleLocalNotification:localNotif];
  14. [localNotif release];
  15.  
  16. [localNotif setTimeZone:[NSTimeZone defaultTimeZone]];
  17. [localNotif setAlertBody:NSLocalizedString(@"Hello!",nil)];
  18. [localNotif setAlertAction:NSLocalizedString(@"Hello", nil)];
  19. [localNotif setSoundName:UILocalNotificationDefaultSoundName];
  20. [localNotif setFireDate:[[NSDate date] addTimeInterval:(60*60)]];
  21. [localNotif setFireDate:[[NSDate date] addTimeInterval:(24*60*60)]];
  22. [[UIApplication sharedApplication] scheduleLocalNotification:localNotif];
  23. [localNotif release];
Add Comment
Please, Sign In to add comment