2012-09-26 39 views
1

我得到這個錯誤,當我寫下面提到的代碼。基本上我想保存UIImagePickerController捕獲到我的應用程序目錄的視頻。我沒有得到我犯了錯誤的地方。請幫我..wait_fences:未能收到回覆:10004003在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"); 
     } 
    } 
} 
+0

什麼是錯誤? – AppleDelegate

+0

錯誤是「wait_fences:無法接收回復:10004003」 –

+0

它已解決? – YaBoiSandeep

回答

1

它是內存的限制(這體現在各種方式)的原因。這也可能是當下載完成時與UI之間的線程交互行爲的原因。有些人表示在顯示UIAlertView和創建UIWebView時存在問題,而後者是在前者之前創建的。 如果您有快速下載連接(在模擬器和本地Web服務器中可能會出現這種情況),那麼您可能會發現,下載速度過快,UI無法準備顯示通知下載完成

+0

我不下載視頻,但它本身是由相機拍攝的。那麼,解決方案是什麼? –

相關問題