speeding view loading
speeding view loading
- Subject: speeding view loading
- From: Olivier Destrebecq <email@hidden>
- Date: Fri, 30 Jul 2004 10:39:16 -0400
I need to create a view from a nib repeatadly and it proves to be time
sonsuming on the computer.
to speed up the process i use this code:
if (cachedViewNib == nil)
cachedViewNib = [[NSMutableDictionary alloc] init];
NSNib *theNib = [cachedViewNib objectForKey: nibName];
if (theNib == nil)
{
theNib = [[NSNib alloc] initWithNibNamed: nibName
bundle: [NSBundle mainBundle]];
[cachedViewNib setObject: theNib
forKey: nibName];
}
NSArray *topLevelObject;
[theNib instantiateNibWithOwner: self
topLevelObjects: &topLevelObject];
The code cache the nib and reuse the nib to create identical views
later on. This speeds the process a lot, but probably not enough yet.
Is there another way to speed up the process a little more?
Olivier Destrebecq
http://www-personal.si.umich.edu/~olivier/portfolio/Resume.html
_______________________________________________
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.