• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
speeding view loading
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Prev by Date: Re: Extremely naive view of software engineering Was Re: [OT] was: Where is NSList? (All Threads)
  • Next by Date: Re: [OT] was: Where is NSList? (All Threads)
  • Previous by thread: Re: What does it mean when po puts % before class name?
  • Next by thread: Re: speeding view loading
  • Index(es):
    • Date
    • Thread