On Wed, 22 Jun 2011 09:23:54 +0100, Joanna Carter <joa...@carterconsulting.org.uk> said: >Hi folks > >Le 22 juin 2011 à 08:58, Ken Tozier a écrit : > >> I just started using @properties this week, so probably don't understand the >> nuances, but after looking at Matt's sample code, reading the property >> related docs and doing some experimentation, I'm not sure I understand what >> problem he's trying to solve. Is he talking about overriding inherited >> getters/setters? >> >> With my own very limited experience with properties, it seems to be really >> easy to add functionality. Just write the getter/setter yourself. When you >> go to use them, they behave exactly like the auto generated ones re dot >> syntax, and do whatever cool thing you added. >> >> What am I missing? > >Yes, I would also like to know what Matt is trying to achieve with all those >machinations that you can't do with a simple ivar in the class and not >bothering to @synthesize.
Well, if you really want to know that, just read the discussion in the book: http://www.apeth.com/iOSBook/ch12.html My thought was (putting myself in the shoes of the student), hey, I have no idea exactly what code @synthesize generates, but whatever it is, it surely constitutes a correct getter and (especially) setter, whereas if I write those things myself (and especially the setter) the chances that I'll do something wrong are quite high. So the question is simply, how can I add my own functionality while at the same time inheriting all the synthesized accessors' yummy goodness, whatever it may be? m. -- matt neuburg, phd = m...@tidbits.com, <http://www.apeth.net/matt/> A fool + a tool + an autorelease pool = cool! Programming iOS 4! http://www.apeth.net/matt/default.html#iosbook_______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com