永远不会读取在初始化期间存储到秒的值

时间:2012-03-19 20:33:21

标签: iphone

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然后执行此操作

2 个答案:

答案 0 :(得分:4)

float seconds = audioPlayer.currentTime;

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

答案 1 :(得分: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 {

}