Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 01-12-2009, 12:37 PM   #9 (permalink)
smasher
Senior Member
iPhone Dev SDK Supporter
 
smasher's Avatar
 
Join Date: Jul 2008
Location: San Mateo, CA (San Fran)
Posts: 3,858
Default

Quote:
Originally Posted by DenVogel View Post
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.
__________________

Free Games!
smasher is offline   Reply With Quote
 

» Advertisements
» Online Users: 769
15 members and 754 guests
ADY, antonwilliams, at0m87, bocaraton, charles.scholten, Domele, hiddendemo, Hirley2324, iphone.savvy, J.Steve, smarkmee, srilu, suresk, thitikorn
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,630
Threads: 89,146
Posts: 380,340
Top Poster: BrianSlick (7,110)
Welcome to our newest member, thitikorn
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 02:19 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.