views:

28

answers:

2

Hello everyone!

So, I'm actually making an iPhone app with a big library of guitar chords and scales. The scales are logical, so they are successfully draw by following musical theory.

On the other hand, I have a library of 4500 small png files (3ko) for the guitar chords.

My problem is that even if it's not used for the launch (but for a viewController who call them by a variable NSString like @"%@ chord_%@.png") the app link them (with the dyld) when the app launches.

So after the loading the app is very very fast, but it takes about 12 seconds to launch.

Any ideas?

Thanks

Séraphin

A: 

Image files are not linked into the app using dyld. You could perhaps use Instruments to pinpoint the slowdown more accurately, but it seems like you might consider a different solution than using 4500 individual images.

Is it possible for you draw these chords programmatically? Perhaps composite several simpler images together? Even at 3kb/image it seems like that many images would make your application download size significantly larger.

Joey Hagedorn
The application is about 20Mb! Not even an image is called before the "third view" of my application. I'll try to put them all in a db! If it doesn't work, i'll try to draw them :) Thanks!
Séraphin Hochart
A: 

Are you reading all 4500 images at launch time? If so, dont. Instead, only read an image with it is needed the first time.

Ash White
No, tha database is used like on my third viewController!
Séraphin Hochart
Thanks for replying! In the logic of my application I have 4 imageViews on that viewController, then depending of what the user wanted before, it generates a string, and call the images corresponding to those strings only at that time!
Séraphin Hochart