When you set the myWindow ivar in IB then your setter will get called.
This is just an example, not useful code.
Scott
On Apr 22, 2008, at 12:43 PM, Niko Matsakis wrote:
We got into this whole debate in the cocoa dev list about prefixes.
I was using them for a while until i started doing Objective C 2.0
work. Then voted against using prefixes in ivars like _, m_, etc.
The reasoning for this was i would like the accessors to be used
when setting things using interface builder to setup interface
objects. This keeps the pattern of using the accessors consistent.
I don't quite understand. Are you saying the IB invokes an accessor
if it exists? If so, why not just use the name of the accessor in
IB rather than the instance variable name, and keep the naming prefix?
If not, that is if IB just sets the field directly via magic, then
it seems to me clearer to have a prefix name that means "no magic",
whether it's in IB or in Obj-C source code.
However, I don't feel strongly about it. To each their own. :) I
just thought I'd share a technique I've found useful for ensuring
that accessors are used consistently.
Niko
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Objc-language mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/objc-language/email@hidden