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動畫的加載需要很長時間。