1
- (IBAction)randomnum{ int randomNumber1 = 1+ arc4random() %(49); label1.text = [NSString stringWithFormat:@"d", randomNumber]; 

Warning:

Local declaration of randomNumber hides instance variable.

How can i get round this warning?

4
  • stackoverflow.com/questions/2560980/… Commented May 15, 2010 at 12:28
  • Is the 1 in randomNumber1 intentional or a typo? Commented May 15, 2010 at 12:29
  • 2
    @Hamish, how is that a dup of this question? Commented May 15, 2010 at 12:30
  • It is not a dupe of the question. Commented May 15, 2010 at 12:47

1 Answer 1

4

You had some instance variable of the class with the same name of your randomNumber1 or randomNumber. Recheck for that and change the name, you would be fine

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.