Hy again, I am still new to objective c and Xcode. I am building a small app and need to use a variable in a Method. I don't know where to put it so I can use it in the Method.
I have a button which starts the whole process but the Method of this button needs a variable which only should be created once (because its a random number) and be saved so the "Button Method" can use it to compare it. Where do I place it so my variable stays the same while my Method can use it?
Thx
- (IBAction)guessButton:(id)sender {
NSLog(@"Answer = %i", answer);
NSLog(@"Button Pressed");
float guess = [[self.guessTextField text] floatValue];
NSLog(@"Guess = %f", guess);
}
