Created
April 27, 2011 23:52
-
-
Save rociiu/945504 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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