2011-07-18 46 views
0

私は3つのUILabels(display1、display2、display3)でクロスディゾルブをしようとしています。ブロックアニメーションを使用してフェードアウトし、テキストを変更して一度に1つずつフェードします。私が使用しているコードは次のとおりです。animateWithDurationが認識されませんか?

[UIView animateWithDuration:1.0 delay: 1.0 
    animations:^{ 
     display1.alpha = 0.0; 
     display2.alpha = 0.0; 
     display3.alpha = 0.0; 
    } 
    completion:^{ 
     [display1 setText:[NSString stringWithFormat:@"%@",[engine getstring]]]; 
     [display2 setText:[NSString stringWithFormat:@"%@",[engine getstring]]]; 
     [display3 setText:[NSString stringWithFormat:@"%@",[engine getstring]]]; 
     [UIView animateWithDuration:1.0 delay:1.0 
      animations:^{ 
       display1.alpha = 1.0; 
       [UIView animateWithDuration:1.0 delay:1.0 
        animations:^{ 
         display2.alpha = 1.0; 
         [UIView animateWithDuration:1.0 
          delay:1.0 
          animations:^{ 
           display3.alpha = 1.0; 
          } completion:nil]; 
        } completion:nil]; 
     } completion:nil]; 
    }]; 

私は次の警告を得る:

Method '+animateWithDuration:delay:animations:completion:' not found* 

'UIView' may not respond to method '+animateWithDuration:delay:animations:completion:' 

私は4.3のiOS版のビルドターゲットとのXcode 4.0を使用しています。

答えて

1

代わり

+ animateWithDuration:delay:options:animations:completion: 

を使用します。途中のoptions:に注意してください。

+0

ありがとうございました。あなたは絶対に正しいです。ファットフィンガーの瞬間、そしてそこになかったものが見えない! –

+0

@ジョン:喜んでそれを整理しました。これがうまくいく場合は、ちょっとしたチェックマークをクリックして正しい答えとして「受け入れる」ことをお勧めします。あなたのアプリには最高の運があります。 – PengOne

関連する問題