Loading nib files really fast

337 Views Asked by At

Trying to load a few hundred UINib consecutively and really fast (one after the other in less than 0.5sec). UINib contain UIButton and a relatively small sized image (different for each nib).

I have tried this:

UINib *nib = [UINib nibWithNibName:viewName_ bundle:[NSBundle mainBundle]];
        [nib instantiateWithOwner:self options:nil];
        mainView = [[nib instantiateWithOwner:self options:nil] objectAtIndex:0];

and this:

mainView = [[[NSBundle mainBundle] loadNibNamed:viewName_ owner:self options:nil] objectAtIndex:0];

with the last being a few milliseconds faster and CPU usage is 92% vs 97%.

Which is the best way to load these nibs even faster? Or is there a better way to do this?

thanks

1

There are 1 best solutions below

0
On BEST ANSWER

Ok the solution was really easy to this. In case someone else comes across. Wait for Apple to fix it!

9.1 works like a charm. Everything loads super fast as expected. Thanks for your input.