Comment passer d'un argument à une méthode appelée dans un NSTimer

J'ai une minuterie de l'appel d'une méthode, mais cette méthode prend un paramether:

theTimer = [NSTimer scheduledTimerWithTimeInterval:animationInterval target:self selector:@selector(timer) userInfo:nil repeats:YES];

devrait être

theTimer = [NSTimer scheduledTimerWithTimeInterval:animationInterval target:self selector:@selector(timer:game) userInfo:nil repeats:YES];

maintenant cette syntaxe ne semble pas être de droite. J'ai essayé avec NSInvocation, mais j'ai eu quelques problèmes:

timerInvocation = [NSInvocation invocationWithMethodSignature:
        [self methodSignatureForSelector:@selector(timer:game)]];

theTimer = [NSTimer scheduledTimerWithTimeInterval:animationInterval
        invocation:timerInvocation
        repeats:YES];

Comment dois-je utiliser Invocation?

InformationsquelleAutor Michele | 2011-03-02