Skip to content

Instantly share code, notes, and snippets.

@rociiu
Created April 27, 2011 23:52
Show Gist options
  • Save rociiu/945504 to your computer and use it in GitHub Desktop.
Save rociiu/945504 to your computer and use it in GitHub Desktop.
//Run this code in a simulator for the iPhone and it will crash DO NOT RUN ON DEVICE, gets fscked
- (void) setAlarmOfDoom:(NSDate *)newAlarm {
{
UIApplication* app = [UIApplication sharedApplication];
// Create a new notification.
for(int i = 0; i < 10 ; i++) {
UILocalNotification* alarm = [[[UILocalNotification alloc] init] autorelease];
if (alarm)
{
alarm.fireDate = newAlarm;
alarm.timeZone = [NSTimeZone defaultTimeZone];
alarm.repeatInterval = 2;
alarm.alertBody = @"BOOM!.";
[app scheduleLocalNotification:alarm];
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment