重新打开viewcontroller时,块参数不起作用

时间:2015-01-13 23:12:19

标签: ios objective-c block

这是我的代码:

-(void)playCurrentTrack
{
    [[AFSoundManager sharedManager] startStreamingRemoteAudioFromURL:[[Playlist sharedInstance] currentSong].URLString andBlock:^(int percentage, CGFloat elapsedTime, CGFloat timeRemaining, NSError *error, BOOL finished) {
        if (!error) {
            //some labels changing
        } else {
            NSLog(@"There has been an error playing the remote file: %@", [error description]);
        }
    }];
}

当我重新打开包含它的viewcontroller时,块中的代码停止执行。

这是AFSound manager library代码

-(void)startStreamingRemoteAudioFromURL:(NSString *)url andBlock:(progressBlock)block {
    //Some code here
    if (block) {
                block(percentage, CMTimeGetSeconds(_player.currentItem.currentTime), timeRemaining, error, NO);
            }
    //some other code
}

0 个答案:

没有答案