gpt4 book ai didi

iphone - wait_fences : failed to receive reply: 10004003 in UIImagePickerController

转载 作者:行者123 更新时间:2023-11-29 13:28:04 25 4
gpt4 key购买 nike

我在编写下面提到的代码时遇到了这个错误。基本上我想将 UIImagePickerController 捕获的视频保存到我的应用程序目录中。我没有得到我犯错的地方。请帮助我..

- (void) imagePickerController: (UIImagePickerController *) picker didFinishPickingMediaWithInfo: (NSDictionary *) info
{
NSString *mediaType = [info objectForKey: UIImagePickerControllerMediaType];
[self dismissModalViewControllerAnimated:NO];
// Handle a movie capture
if (CFStringCompare ((__bridge_retained CFStringRef) mediaType, kUTTypeMovie, 0) == kCFCompareEqualTo)
{
NSArray *documentPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDir = [documentPaths objectAtIndex:0];
NSString *movieName = [NSString stringWithFormat:@"%@.mov",[self getNameForVideo]];
NSString *moviePath = [documentsDir stringByAppendingPathComponent:movieName];
NSURL * movieURL = [info valueForKey:UIImagePickerControllerMediaURL];
NSData * movieData = [NSData dataWithContentsOfURL:movieURL];
if([movieData writeToFile:moviePath atomically:NO])
{
[self saveVideoInfoInDatabase];
}
else
{
NSLog(@"Video could not be saved to the document directry");
}
}
}

最佳答案

这是内存限制的原因(以各种方式表现出来)。这也可能是下载完成时间与当时 UI 之间的线程交互行为的原因。有些人指出显示 UIAlertView 和创建 UIWebView 存在问题,当后者在前者之前创建时。 如果您有快速下载连接(在模拟器和本地 Web 服务器中很可能就是这种情况),那么您可能会发现下载完成速度太快,用户界面无法准备好显示下载完成的通知

关于iphone - wait_fences : failed to receive reply: 10004003 in UIImagePickerController,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12599384/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com