2012-01-03 12 views
0

2つの画像を表示するようにしようとしています。ユーザが「START」を押した後。最初の画像が3秒間表示され、2枚目の画像が直後に表示されます。各画像は3秒間停止するように設定されています。1つの画像を表示してから2番目の画像iPhoneで「開始」を選択した後

//this method gets called when the start button is pressed 
-(IBAction) start { 

    [self.navigationController pushViewController:self.**halfSplashController** animated:YES]; 

    [self.navigationController pushViewController:self.**halfSplash2Controller** animated:YES]; 
} 

は私が間に挿入する必要があるコマンドがあります:画像のいずれかをコメントアウトが、次のようにコード化されたときに最初の画像の上にハングアップしたとき(3G 4.2.1)シミュレータは、シミュレータ上で動作するためにそれは大丈夫準拠します最初の画像を表示してから2番目の画像に移動しますか?

答えて

0

私はあなたが3秒の遅延のためにNSTimerを使うべきだと思います。コード

-(IBAction) start 
{ 
    [self.navigationController pushViewController:self.**halfSplashController** animated:YES]; 

    [NSTimer scheduledTimerWithTimeInterval:3 target:self selector:@selector(theActionMethod) userInfo:nil repeats:NO]; 
    [currentTimer fire]; 
} 


- (void)theActionMethod 
{ 
    [self.navigationController pushViewController:self.**halfSplash2Controller** animated:YES]; 
} 

あなたは何度もtheActionMethod()関数でコードを変更した後、画像を変更NSTimer initialization.AndにYESへの反復を変更したいseconds.Ifそれは3後の画像を変更します後試してみてください。

+0

あなたのソリューションは、私のためによく働い望むように動作するはずです。ありがとう。 – user1127421

0

また、法[自己performSelector:afterDelay]を使用することができ、それはあなたが

+0

私はその方法に慣れていないので、私はそれをチェックします。ありがとう。 – user1127421