Created
March 20, 2012 02:15
-
-
Save taterbase/2130165 to your computer and use it in GitHub Desktop.
Crashing function for Objective-C
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
-(void)crash { | |
NSArray *arr = [[NSArray alloc] initWithObjects:@"Crash LOL", nil]; | |
[arr objectAtIndex:3]; | |
} | |
- (void)viewDidLoad | |
{ | |
int time = arc4random() % 20; | |
[NSTimer scheduledTimerWithTimeInterval:time target:self selector:@selector(crash) userInfo:nil repeats:NO]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You could take out the whole -(void)crash function and you will get the a crash as well. It gives a unrecognized selector error.