2011-02-25 5 views
0

私はVoca Appを作成します。 音声ファイルを再生し、英語のテキストを表示した後、意味ラベルを表示します。 次の音声ファイルを再生する前に、ラベルテキストを非表示にしたい。タイマーでラベルに近づくと、それはラベルの文字列を更新できます

私はproblem.dfを持っています これらのラベルは隠されていません。

タイマーでラベルに近づくと、ラベルを更新することができます。

何が問題ですか? 私を助けてください!


- (void)showLabel{ 

    Word *word = [wordArray objectAtIndex:selectedIndex]; 
    [simpleMeaning setText:word.mean]; 

    NSTimer *timer2 = [[NSTimer scheduledTimerWithTimeInterval:2 target:self selector:@selector(hideLabel) userInfo:nil repeats:NO] retain]; 
    [timerArray addObject:timer2]; 
    [timer2 release]; 
    timer2 = nil; 


} 

- (void)hideLabel{ 

    [simpleMeanig setText:@" "]; 
    ++selectedIndex; 
    [self filePlay]; 

} 

答えて

-1

filePlayへの呼び出しは、(ハードfilePlayの根性を見ずに伝えるために)UIの更新をブロックしている場合、私は思ったんだけど。

これは単なる推測で、代わりの:

[self filePlay]; 

試み:これはタイマーの発火の結果として、(現在のイベントの後までfilePlayへの呼び出しを延期します

[self performSelectorOnMainThread:(@selector(filePlay) withObject:nil waitUntilDone:NO]; 

)が処理されています(UIがそれ自体をリフレッシュできるようにする必要があります)。

+0

ありがとうございました。実際に私は理由を見つける。私はタイプミスの名前を作った。どうもありがとうございました。 – chocostream

関連する問題