我在线程中有一个方法。在调用线程之前,我禁用了一个按钮,我可以看到更改了alpha的按钮。 在线程内部,我调用异步方法AVAssetExportSession,然后启用按钮。 该按钮工作正常但alpha不会立即改变。有时是0.1秒后,有时是4秒后。 我试图在主线程中执行启用,但我遇到了同样的问题。 关于它的任何线索? 感谢名单
更新:我会尝试编写一些代码。
[NSThread detachNewThreadSelector:@selector(importaVideo:) toTarget:self withObject:arrayParam];
这就是所谓的方法:
AVAssetExportSession *exportSession = [[AVAssetExportSession alloc] initWithAsset:asset presetName:[Utilidades getQualityExport]];
exportSession.outputFileType = AVFileTypeQuickTimeMovie;
exportSession.outputURL = [NSURL fileURLWithPath:[Utilidades devuelvePath:filenameVideo]];
[exportSession exportAsynchronouslyWithCompletionHandler:^{
self.buttonSettings.enabled = YES;
}];
我知道这不是完整的代码,但另一部分有点复杂,并不影响最终结果。