Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Objective-C 2.0 style question.



On Tue, Apr 22, 2008 at 12:43 PM, Niko Matsakis <email@hidden> 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?

"During the reconnection process, the nib-loading code reconnects any
outlets, actions, and bindings you created in Interface Builder. When
reestablishing outlet connections, Cocoa tries to do so using the
object's own methods first. For each outlet, Cocoa looks for a method
of the form setOutletName: and calls it if such a method is present.
If it cannot find such a method, Cocoa searches the object for an
instance variable with the corresponding outlet name and tries to set
the value directly. If the instance variable cannot be found, no
connection is created."

<http://developer.apple.com/documentation/Cocoa/Conceptual/LoadingResources/CocoaNibs/chapter_3_section_3.html>

-Shawn
 _______________________________________________
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

This email sent to email@hidden

References: 
 >Objective-C 2.0 style question. (From: Scott Andrew <email@hidden>)
 >Re: Objective-C 2.0 style question. (From: Niko Matsakis <email@hidden>)
 >Re: Objective-C 2.0 style question. (From: Scott Andrew <email@hidden>)
 >Re: Objective-C 2.0 style question. (From: Niko Matsakis <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.