Re: Simple loadNibNamed Question
Re: Simple loadNibNamed Question
- Subject: Re: Simple loadNibNamed Question
- From: Daniel Jalkut <email@hidden>
- Date: Fri, 3 Feb 2006 21:42:32 -0500
Yes, you will get multiple instances. That's the beauty of the Nib!
You often want to use it as a "starting point" for multiple objects
(like documents, for instance).
How do you check if a nib is already loaded? Keep track of it
yourself. If you think of Nibs as a file with information that tells
Cocoa how to instantiate stuff, then it doesn't make sense to ask "is
it loaded" any more than it makes sense to ask (for instance) "did I
already read the contents of some file into memory once?" You have to
be in charge of the objects you allocate and keep track of whether
you want to allocate new ones or not.
Daniel
On Feb 3, 2006, at 10:47 AM, Koen Bok wrote:
If I call loadNibNamed:owner: for the same NIB more than one time
in my application, will it load multiple instances of the nib into
the memory? Or will it only load it if it is not loaded yet? If
not, what is the way to check if a NIB is already loaded?
Koen _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
sweater.com
This email sent to email@hidden
_______________________________________________
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