我有一个计时器调用一个方法,但这个方法需要一个参数:
theTimer = [NSTimer scheduledTimerWithTimeInterval:animationInterval target:self selector:@selector(timer) userInfo:nil repeats:YES];
应该
theTimer = [NSTimer scheduledTimerWithTimeInterval:animationInterval target:self selector:@selector(timer:game) userInfo:nil repeats:YES];
现在这种语法似乎不正确。我尝试使用 NSInvocation 但遇到了一些问题:
timerInvocation = [NSInvocation invocationWithMethodSignature:
[self methodSignatureForSelector:@selector(timer:game)]];
theTimer = [NSTimer scheduledTimerWithTimeInterval:animationInterval
invocation:timerInvocation
repeats:YES];
我应该如何使用调用?