Advertise Books Events Forum News Social Networking Support Us

sdkIQ for iPhone
($4.99)

Shape Up
($0.99)

Your First iPhone App
($1.99)

iVidCam Free
(free)

Kid Art
($0.99)

iPUBQUIZ
(£1.19)

ArtStudio
($3.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 01-12-2009, 11:37 AM   #9 (permalink)
smasher
Senior Member
iPhone Dev SDK Supporter
 
smasher's Avatar
 
Join Date: Jul 2008
Location: San Mateo, CA (San Fran)
Posts: 2,547
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.
__________________
smasher is online now   Reply With Quote
 
Enter the iPhone App Challenge!  Win $500!
» Advertisements
» Stats
Members: 23,819
Threads: 38,588
Posts: 169,438
Top Poster: smasher (2,547)
Welcome to our newest member, tallyho
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 06:37 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.