So, I am making the application very fast, and although this is not the best solution, it seems to work for the most part. So I have a simple image that pulls an image from NSMutableArray arr. I create an array and populate it inside ViewDidLoad this way:
arr = [[NSMutableArray alloc] init];
[arr addObject:[UIImage imageNamed:@"181940jpg"]]
[arr addObject:[UIImage imageNamed:@"168026.jpg"]]
[arr addObject:[UIImage imageNamed:@"168396.jpg"]]
[arr addObject:[UIImage imageNamed:@"168493_.jpg"]]
And I continue to do this for 130 images. Obviously, this is a large array. I donβt know if this is really a really bad way, but if so, I am open to suggestions! When I look through the array using simple back and forward buttons, pulling images from the array based on a simple counter variable, everything works fine until the 45-ish image. The application breaks up and the console says this:
* ERROR: ImageIO header 'ImageProviderCopyImageBlockSetCallback' is not CFDictionary ...
Would it help me if I broke my images into separate arrays? Am I just putting too much into an array? What I'm missing here, believe me, I'm all ears.
thank
EDIT: here is more info
This is how I sift the array using the UISegmentedControl set at the top of the screen:
-(void) pickedOne{
if(segmentedControl.selectedSegmentIndex == 1){
NSLog(@"hey");
if(position < [arr count]-1){
position++;
UIImage * img = [arr objectAtIndex:position];
[imageView setImage:img];
[img release];
}
}else if(segmentedControl.selectedSegmentIndex ==0){
if(position >0){
position--;
UIImage * img = [arr objectAtIndex:position];
[imageView setImage:img];
[img release];
}
}
}
This is not a memory management problem, but again, I do not consider myself a professional in this in any way ...
source
share