2012-03-19 52 views
0
float seconds = audioPlayer.currentTime; 
if ((seconds = 11)){ 
    [self performSelector:@selector(viewController) withObject:nil]; 
} else { 
    if ((seconds = 23)){ 
     [self performSelector:@selector(secondViewController) withObject:nil]; 
    } else { 
} 

Anyidea如何時,我只是想看看是否audioplayer當前播放時間是11,然後做這個或者23,然後做價值的初始化過程中存儲到秒從來沒有讀過

回答

1

它的修復藍色此消息大概晚了,你只需要第二雙眼睛,一切發生的時間:)試試這個:

float seconds = audioPlayer.currentTime; 

if ((seconds == 11.0)){ 

    [self performSelector:@selector(viewController) withObject:nil]; 

    } else { 

if ((seconds == 23.0)){ 
    [self performSelector:@selector(secondViewController) withObject:nil]; 


} else { 

} 
4
float seconds = audioPlayer.currentTime; 

if (seconds == 11.0) { 
    // Do something 
} else if (seconds == 23.0) { 
    // Do something else 
} else { 
    // Do something else 
} 
+0

我花了我今天的投票配額,否則你應得+1不僅回答,也提高了代碼:) – 2012-03-19 20:46:22

+1

+ 1不僅回答,而且還改善代碼,嘿嘿:) – 2012-03-19 22:08:54

+0

過去午夜UTC,所以這裏它去... :) – 2012-03-20 00:01:07

相關問題