when my app starts it loads 60 images at a time in UIImageView
and it also loads a background music.
in simulator it works fine but in IPAD it crashes..
-(void)viewDidLoad
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
//img.animationImages = [[NSArray arrayWithObjects:
MyImages = [NSArray arrayWithObjects:
//[UIImage imageNamed: @"BookOpeningB001.jpg"],...... B099,nil];
//[NSTimer scheduledTimerWithTimeInterval: 8.0 target:self selector:@selector(onTimer) userInfo:nil repeats:NO];
img.animationImages = MyImages;
img.animationDuration = 8.0; // seconds
img.animationRepeatCount = 1; // 0 = loops forever
[img startAnimating];
[self.view addSubview:img];
[img release];
[pool release];
//[img performSelector:@selector(displayImage:) ];
//[self performSelector:@selector(displayImage:) withObject:nil afterDelay:10.0];
[self performSelector: @selector(displayImage) withObject: nil afterDelay: 8.0];
}
-(void)displayImage {
SelectOption *NextView = [[SelectOption alloc] initWithNibName:nil bundle:nil];
[self presentModalViewController:NextView animated:NO];
[NextView release];
}
Am i doing anything wrong ?
Is there any other alternative to load the local images faster in
UIImageView !
I was doing something similar. Even if you quit all of the other apps on your iPad and manage to get it to run it will crash on you randomly.
I fixed this by preload very small (like 5 or 6 k) gif images. Then when my user entered an area where the big image needed to be seen I loaded the full res pic as a jpg and released the object as soon as they were done with it.
Now my app no longer has an issue on the simulator or the device and I do not have to have the user close everything.