Please help me ! I make an app like a slide show with back, previous button to change Image one by one. But when I using large image it crash. Now I'm using 64 jpg pics , size~20kb/1pic.
Help me or I die ! (U can add nick hoangtuanfithou, please) code like that :
//Init Image Array
-(void)InitImageArray1
{
myAnimationImages1 = [[NSMutableArray alloc] init];
for ( int i = 0; i < 24; i++ )
{
NSAutoreleasePool *poolArray=[[NSAutoreleasePool alloc] init];
NSString *fileName = [NSString stringWithFormat:@"001 (%d)",i];
image = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:fileName ofType:@”jpg”]];
[myAnimationImages1 addObject:image];
[poolArray release];
}
}
//Change Image self.mainImage.image = [self.myAnimationImages1 objectAtIndex:animationImageArrIndex];
请参阅苹果的页面控制示例,或查看github上的滚动疯狂。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.