Re: Accessing interface elements (iPhone vs Mac)
Re: Accessing interface elements (iPhone vs Mac)
- Subject: Re: Accessing interface elements (iPhone vs Mac)
- From: Adam Venturella <email@hidden>
- Date: Wed, 21 Jan 2009 10:25:50 -0800
I have seen this same behavior too, creating @properties for IBOutlets
on the iPhone. I have yet to run into a problem not
@property/@synthsizeing my Outlets on the iPhone, everything seems to
work just fine if you don't. So am I missing something? And am I
correct in assuming you would then be responsible for [myOutlet
release] in the dealloc?
On Wed, Jan 21, 2009 at 10:04 AM, Shawn Erickson <email@hidden> wrote:
> 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
>
_______________________________________________
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