I'm trying to make a simple loop and it crashes every time I run it
- (IBAction) goStrobe:(id) sender {
[NSTimer scheduledTimerWithTimeInterval:2.0
target:self
selector:@selector(runLoop:)
userInfo:nil
repeats:YES];
}
- (void) r开发者_C百科unLoop {
if (imageTwo.hidden = YES) {
imageTwo.hidden = NO;
}
if (imageTwo.hidden = NO) {
imageTwo.hidden = YES;
}
}
My code is above. Every time I trigger goStrobe, it crashes and I can't figure out why. Any help would be greatly appreciated. Thanks
It's your runLoop function signature which is wrong in the selector, just remove the ":" at the end. You don't need this because your function does not take any parameters.
精彩评论