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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to