Re: Questions about Nib Object Retention
Re: Questions about Nib Object Retention
- Subject: Re: Questions about Nib Object Retention
- From: Joar Wingfors <email@hidden>
- Date: Tue, 20 Oct 2009 21:50:37 -0700
On 20 okt 2009, at 20.40, an0 wrote:
Who owns the unarchived top-level objects' initial positive retain
count?
The "Files Owner" is responsible for the top level objects. It better
have outlets to them so that it can manage and dispose of them
appropriately. It sounds like you're asking about this in the context
of Mac OS X and Reference Counting? As you've noted from the
documentation, the rules differs between Mac and iPhone, and between
GC and RC.
Are they retained for outlet connections?
Or are they just not autoreleased only because they are top-level,
regardless of whether there are any outlet connected to them?
They're retained regardless of if there are outlets for them or not.
If you use NSViewController or NSWindowController subclasses to load
nib files, you don't have to care about this, since they manage the
top level objects for you. This is a very good reason to always try to
do your nib loading from subclasses of these classes if possible.
j o a r
_______________________________________________
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