• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Questions about Nib Object Retention
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Questions about Nib Object Retention
      • From: Graham Cox <email@hidden>
References: 
 >Questions about Nib Object Retention (From: an0 <email@hidden>)

  • Prev by Date: How to run a panel that customizes a new NSDocument
  • Next by Date: Re: Calling method in brand new view to set a variable?
  • Previous by thread: Re: Questions about Nib Object Retention
  • Next by thread: Re: Questions about Nib Object Retention
  • Index(es):
    • Date
    • Thread