Re: Should I retain/release IBOutlet?
Re: Should I retain/release IBOutlet?
- Subject: Re: Should I retain/release IBOutlet?
- From: Bill Bumgarner <email@hidden>
- Date: Sat, 13 May 2006 20:24:34 -0700
On May 13, 2006, at 6:06 PM, Lon Giese wrote:
Im sure someone will argue with my answer but that's ok... Only
top level objects in the Nib need to be released by you.. those are
all the objects in the little window that contains 'File's Owner'.
all other objects in a nib will be released automatically... for
example any buttons you put in a window will be released by the
window when it is deallocated. Now I never release the main menu
even though it is a top level object, this is probably not
stylistically correct but I never have any problem with it, since
the main menu normally stays in existence throughout the
application's life... Whatever object (usually File's Owner)
that created the nib should release the top level objects in it...
I strongly suggest using the document architecture because it
automates many various tasks into a really nice way of managing
nibs, window controllers and documents... It doesn't really
matter if the object is connected to an IBOutlet or not, but I
might be wrong about that I don't know everything about nibs
yet... There are funny things that happen (and not very well
documented) when you connect outlets between two different Nibs...
I would suggest reading the documentation (and not restating the
documentation as per list guidelines).
Specifically, start here:
http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/
MemoryMgmt.html
Then read this:
http://developer.apple.com/documentation/Cocoa/Conceptual/
LoadingResources/Concepts/NibFileLoaded.html#//apple_ref/doc/uid/
20000884
For Core Data:
http://devworld.apple.com/documentation/Cocoa/Conceptual/CoreData/
Articles/cdMemory.html
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden