Re: Accessing interface elements (iPhone vs Mac)
Re: Accessing interface elements (iPhone vs Mac)
- Subject: Re: Accessing interface elements (iPhone vs Mac)
- From: Shawn Erickson <email@hidden>
- Date: Wed, 21 Jan 2009 10:04:34 -0800
On Tue, Jan 20, 2009 at 5:30 PM, Graham Cox <email@hidden> wrote:
> When the nib is loaded, the accessor is used rather than setting the ivar directly (as per Mac)
To be clear NIB loading on Mac OS X will use a setter if one exists
(assuming a name match)...
Outlet connections
In Mac OS X, the nib-loading code tries to reconnect outlets 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.
...
So if you are targeting Mac OS X 10.5 and later you can use the same
property syntax as you see on the iPhone ... the same consistent
pattern will support both.
-Shawn
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden