Re: [noob] Best practice for creating multiple instances of a View
Re: [noob] Best practice for creating multiple instances of a View
- Subject: Re: [noob] Best practice for creating multiple instances of a View
- From: mmalc Crawford <email@hidden>
- Date: Fri, 20 Mar 2009 12:42:26 -0700
On Mar 20, 2009, at 11:19 AM, Stuart Malin wrote:
Presently, I load the Nib for each occurrence needed. But I now
wonder if this is the best approach (going back to the Nib file and
loading each time). Is there an alternative way to achieve this --
perhaps placing the target NSView in some other Nib container (such
as with the controller and view that manage and contain the multiple
instances of the target view) and somehow creating new instances? I
have looked through the NSView reference material, and some of the
Nib reference material, and don't see any obvious alternative.
[...]
March 20, 2009 11:53:59 AM
No performance issues -- just had been wondering about the effect of
going back to disk every time I need one of these views (which will
be frequent and there will be many). Perhaps the fact of disk
caching makes this a non issue.
Modulo other's comments about premature optimisation, if you want to
avoid going back to the disk:
<http://developer.apple.com/DOCUMENTATION/Cocoa/Reference/ApplicationKit/Classes/NSNib_Class/Reference/Reference.html
>
initWithNibNamed:bundle:
instantiateNibWithOwner:topLevelObjects:
mmalc
_______________________________________________
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