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 05-06-2009, 12:15 PM   #6 (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 exorcyze View Post
It's true that prefixing with self calls the setter method. But the point is that in cases where no retain/copy/release is being performed in the setter ( IE when you specify assign, readwrite, etc for nonatomic properties ) that the two are functionally performing the same thing behind the scenes.
Usually but not always; I think jtara's point is that there are other situations where the setter and getter might do something other than directly set the ivar.

For example, I might have two properties, angleInRadians and angleInDegrees, but only one ivar for angle, and write getters and setters to modify that ivar. In that case, "self.angleInRadians = blah" would be correct, and just "angleInRadians = blah" would be an error.
__________________

Free Games!
smasher is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 158,808
Threads: 89,206
Posts: 380,627
Top Poster: BrianSlick (7,129)
Welcome to our newest member, kaileymo123
Powered by vBadvanced CMPS v3.1.0

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