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 > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 07-29-2010, 04:35 PM   #1 (permalink)
Registered Member
 
Join Date: Aug 2009
Posts: 51
Send a message via Yahoo to Dan the Man Send a message via Skype™ to Dan the Man
Default Public and private variables (pure curiosity)

What are public and private variables? And how are they used?
Dan the Man is offline   Reply With Quote
Old 07-29-2010, 05:05 PM   #2 (permalink)
Registered Member
 
Join Date: Jun 2009
Location: Ypsilanti, Michigan
Age: 63
Posts: 1,526
Default

Quote:
Originally Posted by Dan the Man View Post
What are public and private variables? And how are they used?
Avoid public variables as much as possible. Use setters and getters instead.
RLScott is offline   Reply With Quote
Old 07-29-2010, 05:43 PM   #3 (permalink)
Registered Member
 
Join Date: Aug 2009
Posts: 51
Send a message via Yahoo to Dan the Man Send a message via Skype™ to Dan the Man
Default

Quote:
Originally Posted by RLScott View Post
Avoid public variables as much as possible. Use setters and getters instead.
ok... but what are they?
Dan the Man is offline   Reply With Quote
Old 07-29-2010, 05:45 PM   #4 (permalink)
Registered Member
 
Join Date: Aug 2008
Location: Memphis, TN, USA
Age: 24
Posts: 3,558
Send a message via ICQ to smithdale87 Send a message via AIM to smithdale87 Send a message via Skype™ to smithdale87
Default

it has to do with variable scope. Public variables are accessible to the "public", i.e. other classes. Private variables are only accessible to the same class.
smithdale87 is offline   Reply With Quote
Old 07-29-2010, 06:20 PM   #5 (permalink)
Pro. Game Developer
iPhone Dev SDK Supporter
 
Join Date: Feb 2009
Location: żLa Islas Hermosas?
Posts: 2,178
Default

And then there are protected members... :/
__________________
~~ Word Flurry ~~ App Store / Website / Facebook
Kalimba is offline   Reply With Quote
Old 08-03-2010, 05:12 PM   #6 (permalink)
Registered Member
 
Join Date: Aug 2009
Posts: 51
Send a message via Yahoo to Dan the Man Send a message via Skype™ to Dan the Man
Default

ok thanks.
Dan the Man is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Stats
Members: 158,885
Threads: 89,230
Posts: 380,765
Top Poster: BrianSlick (7,129)
Welcome to our newest member, bookesp
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 02:34 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0