15

It seems that finishWriting is broken on iOS 6 simulator - it hangs forever. It's now deprecated and replaced by the new finishWritingWithCompletionHandler: - which also never calls the handler.

On real devices running iOS 6, this works just fine as it always did. Also in previous iOS simulators it works just fine. Seems like a bug in iOS 6 simulator.

Anyone else experiencing this or can prove me wrong?

4

2 回答 2

12

我也遇到了这个问题,然后意识到我没有调用 endSessionAtSourceTime: 在启动一个之后。这解决了我的问题。

于 2013-02-01T20:45:27.590 回答
2

好的,在模拟器上找到了解决方法。

看起来 stop 使视频处理线程死锁,因此解决方法是在主线程中调用 stop :

//      in iOS6 Simulator this blocks the video processing thread call back in UI thread.
//       BOOL stop = [assetWriter finishWriting];
[self performSelectorOnMainThread:@selector(stopInOtherThread) withObject:nil]; 

-(void)stopInOtherThread{
    //Stop doesn't block in MainThread
    BOOL stop = [assetWriter finishWriting];
    NSLog(@" assetWriter finishWriting :%d",stop);
}

此解决方法似乎不适用于 finishWritingWithCompletionHandler

我会尝试看看是否可以在 Apple 上提出错误。

于 2012-09-22T09:08:58.337 回答