1
私のアプリケーションデリゲートではperformSelecorInBackground:withObject
を使用してupdateData
メソッドを実行します。最後に、テーブルビューのオブザーバにデータをリロードするよう通知する通知がポストされます。メソッド呼び出しの直後に開始しないアニメーション
私の問題はアニメーションです:以下のコードを使用して、私のアニメーションはメソッドの最後に始まり、performSelector
の直後ではありません。
これはセレクタをバックグラウンド処理することと関係がありますか、それとも私には見えない何かがありますか?
ご協力いただければ幸いです。
ありがとうございます!
- (void) updateData: (NSString *)newVersionNumber {
... CODE ...
UIView *update = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 360, 20)];
update.backgroundColor = [UIColor blackColor];
[self.navController.view addSubview:update];
[self performSelector:@selector(updateDownAnimation) withObject:nil];
... CODE ...
[[NSNotificationCenter defaultCenter] postNotificationName:@"tableviewShouldReload" object:nil];
... CODE ...
[self performSelector:@selector(updateUpAnimation) withObject:nil];
}
- (void) updateDownAnimation {
[UIView animateWithDuration:0.3 animations:^{
_window.frame = CGRectOffset(_window.frame, 0, 20);
}];
}