Quote:
Originally Posted by DenVogel
Should I just ignore the "Warning: local declaration of 'myArray' hides instance variable" messages." that I keep getting?
|
In my code, I put
NSArray *myArray= blah blah blah.
That creates a new array pointer and points it at the array.
If you already have an array pointer, you can just say:
myArray= blah blah blah.
That'll use the array pointer you already have, and fix the warning you were getting. The message you got really means "You already have a variable myArray, and you made another variable called myArray? WTF?"
You can have two variables with the same name - one for the instance and one inside a method - but it's uncommon and can lead to coding mistakes; so the complier warns you
about it.