AVAssetWriter finishWritingWithCompletionHandler must be retained on iOS7, must not on iOS 6
| Originator: | dpassage | ||
| Number: | rdar://15115377 | Date Originated: | 30-Sep-2013 |
| Status: | Duplicate 14765352(Closed) | Resolved: | |
| Product: | iOS SDK | Product Version: | |
| Classification: | Reproducible: | Always |
Summary: The behavior of -[AVAssetWriter finishWritingWithCompletionHandler:] is different between iOS 6 and iOS 7 with regards to whether the calling object needs to retain a reference to the AVAssetWriter. In iOS 6, if you retain a reference, the completion handler is never called; if you do not retain the reference, the completion handler gets called. In iOS 7, the situation is the exact opposite. Retaining the AVAssetWriter results in the completion handler getting called. Steps to Reproduce: Build and run the attached project. There is a single view controller; the switch controls whether the AVAssetWriter is retained or not. The "Go!" button kicks off the build of the movie. On success, the movie is shown; on failure, the spinner just spins. Expected Results: I expect the behavior to be consistent between versions of iOS. Actual Results: I see different behavior between ios6 and 7 builds. Version: See above Notes: Workaround is to add a check based on the iOS version Configuration: Versions I have tested where retaining the AVAssetWriter is required: Simulator running iOS7 32-bit Simulator running iOS 7 64-bit iPod Touch (ME643LL/A) running iOS 7.0 (11A465) iPhone 4S (MD278LL/A) running iOS 7.0.2 (11A501) Versions where the AVAssetWriter must not be retained: Simulator running iOS 6.0 Simulator running iOS 6.1 iPod Touch (MC540LL/A) running iOS 6.1.3 (10B329) (When submitting to Apple, I included repro source; cannot include here for NDA reasons.)
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!