Completion handler is not called on iOS7 GM

前端 未结 5 1086
灰色年华
灰色年华 2020-12-30 02:37

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

The problem is, when I called finishWritingWithCompletionHandler, the completion handler

5条回答
  •  孤城傲影
    2020-12-30 02:55

    Ray Fix, you are right. We need to retain assetWriter. The easiest way is to use it inside the finishWritingWithCompletionHandler block:

            NSError *error = nil;
    
            AVAssetWriter *videoWriter = [[AVAssetWriter alloc] initWithURL:[NSURL fileURLWithPath:path]
                                                                       fileType:AVFileType3GPP
                                                                          error:&error];
            //startWriting, session etc.  
    
            [videoWriter finishWritingWithCompletionHandler:^{
                    NSLog(@"%@",videoWriter);
                    NSLog(@"Write Ended");
                }];
    

提交回复
热议问题