2009-11-27 1 views

答えて

6

NSTimerを使用して自分で実装する必要があります。あなたは、あなたのtextLabel.textの文字を前方から取り出し、後方に追加することによって循環します。

- (void)fireTimer 
{ 
    NSMutableString *mutableText = [NSMutableString stringWithString: textLabel.text]; 
    //Takes the first character and saves it into a string 
    NSString *firstCharText = [mutableText substringWithRange: NSMakeRange(0, 1)]; 
    //Removes the first character 
    [mutableText deleteCharactersInRange: NSMakeRange(0, 1)]; 
    //Adds the first character string to the initial string 
    [mutableText appendString: firstCharText]; 

    textLabel.text = mutableText; 
} 
+0

ヒントの –

+0

おかげで完璧な答えだこと:この簡単にあなたがsubstringWithRange:deleteCharactersInRange:appendStringを使用して操作しますNSMutableStringを使用し、各文字操作後textLabel.textとして設定することができますを行うために。チャーミーのように働いた。 – versatilemind

+0

あまり滑らかではありませんが、結果とコードラインは完璧です! – JOM

関連する問題