画像の配列で構成されるアニメーションがあり、その上で実行します
[myUIImageView startAnimating]
アニメーションを 1 回実行してから、3 秒間停止してから繰り返します。
このアニメーションを別のスレッドで実行する必要があるので、
NSThread *animationThread = [[NSThread alloc] initWithTarget:self selector:@selector(startAnimTask) withObject:nil waitUntilDone:NO];
[animationThread start];
私のviewDidLoadで、次に
-(void) startAnimTask {
//create array of images here; animationDuration (3) and animationRepeatCount (1)
[self setUpAnimation];
while (true){
[myUIImageView startAnimating];
usleep(3);
[myUIImageView stopAnimating];
usleep(3);
}
}
この方法を使用すると、メモリ警告が表示されます。また、MainThread で開始と停止を実行しようとしましたが、うまくいきませんでした。
何か案は?