【问题标题】:wait_fences: failed to receive reply: 10004003 in UIImagePickerControllerwait_fences:未能收到回复:UIImagePickerController 中的 10004003
【发布时间】:2012-09-17 22:34:26
【问题描述】:

我在编写下面提到的代码时遇到了这个错误。基本上我想将 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");
        }
    }
}

【问题讨论】:

  • 错误是“wait_fences: failed to receive reply: 10004003”

标签: iphone ios ios5 ios4 iphone-sdk-3.0


【解决方案1】:

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

【讨论】:

  • 我没有下载视频,但它本身是被相机捕获的。那么,解决方案是什么?
猜你喜欢
  • 2011-05-02
  • 2010-11-25
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-02-05
  • 1970-01-01
相关资源
最近更新 更多