本文介绍了在iOS7 GM上不调用完成处理程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用AVAssetWriter,它完全适用于iOS6。

I'm using AVAssetWriter, and it is perfectly working on iOS6.

问题是,当我调用 finishWritingWithCompletionHandler ,iOS7 GM上没有调用完成处理程序。

The problem is, when I called finishWritingWithCompletionHandler, the completion handler is not called on iOS7 GM.

在我之前,我打电话给 markAsFinished ,甚至 endSessionAtSourceTime 调用finishWritingWithCompletionHandler。

I called markAsFinished, and even endSessionAtSourceTime before I call finishWritingWithCompletionHandler.

在iOS6上运行正常。

It works fine on iOS6.

甚至更多,在iOS7上,它可以工作一段时间,然后它再也不起作用了。

And even more, on iOS7, it works some times, and then it doesn't work again.

我不知道为什么,但如果我使用警报视图调用该方法,它就有效。
所以我尝试了 performSelectorOnMainThread inBackground ,但它没有帮助。

I don't know why, but it works if I call the method using alert view.So I tried performSelectorOnMainThread and inBackground, but it didn't help.

任何想法?

推荐答案

显然你现在需要保留assetWriter。

Apparently you need to retain the assetWriter now.

您可以尝试保留一个强大的属性,看看您的完成处理程序是否被调用。 (务必在完成处理程序中将该属性设置为n。)

You might try retaining with a strong property it and see if your completion handler gets called. (Be sure to nil that property in completion handler.)

这篇关于在iOS7 GM上不调用完成处理程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-01 18:12