I am writing a function in objective C.
That is what I got:
int rndValue = (((int)arc4random()/0x100000000)*width);
timer1 = [NSTimer scheduledTimerWithTimeInterval:.01
target:self
[self performSelector:@selector(doItAgain1:)
withObject:rndValue]
userInfo:nil
repeats:YES];
The selector invokes this method and passes parameter:
-(void)doItAgain1:(int)xValuex{
}
At this stage the top code produces syntax error. Syntax error: 'Expected ] before performSelector' What is the prob?
Best regards
This would be more correct:
Also notice that the syntax for the selector you call in this way must be:
It is not possible to specify an
intargument to such a timer selector, thus the trick to convert it into aNSNumberobject.