开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜