views:

334

answers:

3
NSMutableArray *images = [NSMutableArray arrayWithObjects:[UIImage imageNamed:@"JGirl 01.jpg"],
    [UIImage imageNamed:@"JGirl 03.jpg"], ... ,
    [UIImage imageNamed:@"JGirl 48.jpg"],
    nil];

self.view = [[[SlideShowView alloc] initWithImages:images byIndex:index] autorelease];

assume that my images contain 48 object but when i debug images have only 23 objects.

Why aren't all my images loading?

+7  A: 

Sounds like a problem with nil-termination. If one of your image objects (the 24th, probably) is coming back nil because of a typo in the name or a corrupt/non-existent image file, it will act like the final "nil" that terminates the list and your array will ignore everything after that. It's a common pitfall with arrayWithObjects: and dictionaryWithObjectsAndKeys:

Kenny Winker
That makes sense
nduplessis
+1  A: 

You really shouldn't be loading that many images into memory on the iPhone OS, when you do that you have to load the whole RGB representation of the image, which isn't really something you want to be doing considering the resource constraints on the device.

refulgentis
A: 

thank Kenny and refulgentis for post it cause from "a corrupt/non-existent image file"

refulgentis could you please advise me some tutorial or algorithm to reduce memoryloading for Iphone

thanks

RAGOpoR