0
我使用这个呼叫切换图像每4秒:目标C afterDelay
- (void) settheimage {
cur+=1;
waits=0;
[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(settheimage) object:nil];
jpg = [NSString stringWithFormat:@"%@/%@_%d",current_anim,current_anim, cur];
img = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:jpg ofType:@"jpg"]];
[self performSelector:@selector(settheimage) withObject:nil afterDelay:4.0];
}
它工作在第一图像上,但它崩溃之后。 我不想使用uiimage动画,因为我有很多图像,并且uiimage动画的加载需要很长时间。