Re: speeding view loading
Re: speeding view loading
- Subject: Re: speeding view loading
- From: "Erik M. Buck" <email@hidden>
- Date: Fri, 30 Jul 2004 12:06:37 -0400
A nib is just a file containing archived objects. Some of the objects are
views and some are IB connections etc.
If all you want is many copies of a view [hierarchy] that is in a nib, load
the nib once, extract the view you want, and in future, copy it entirely
within memory using one of the common techniques including the following:
[NSUnarchiver unarchiveObjectWith
Data:[NSArchiver
archivedDataWithRootObject:anObject]];
This will copy an entire view hierarchy including all outlets and
target/action connections within the hierarchy, but not connections to
objects that were not archived.
In fact, Interface Builder does almost exactly this except that the root
object is a private IB class that contains the top level objects (typically
windows, views, menus, and explicitly instantiated objects) as well as
instances of the IB "connection" classes that are used to restore
connections after the nib is reloaded. After the connections have been
restored, you don't need the "connection" instances any more even if you
archive and unarchive. The connection instances just exist to enable
certain design time features of IB.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.