iphone - NSInvalidArgumentException – App terminates while i'm trying to copy a captured video to documents folder -


I want to try the knowledge of the crowd .. because I am just disappointed. . Thanks in advance

So here is my code:

  - (minus) imagePickerController: (UIImagePickerController *) IPC didFinishPickingMediaWithInfo: (NSDictionary *) info { < / Pre> 

NSLog (@ "info:% @", info);

NSString * newFilename = [NSString stringWithFormat: @ ".% @ /% @ Mov", [NSHomeDirectory () stringByAppendingPathComponent: @ "document"], [NSString stringWithFormat: @ "% d", (long ) [[NSDate date] timeIntervalSince1970]]];

NSLog (@ "newFilename:% @", newFilename);

NSFileManager * filemgr = [NSFileManager defaultManager];

NSError * err; If ([copyItemAtPath filemgr: [information objectForKey: @ @ "UIImagePickerControllerMediaURL"] toPath: newFilename error: & amp; ERR] == YES) NSLog ( "Move succeeded"); Other NSLogs (@ "Move Failed");

And it is logged:

  2010-05-16 18: 19: 01.975 Arlkoang [7099: 307] Information: {UIImagePickerControllerMediaType = "public.movie"; UIImagePickerControllerMediaURL = "file: //localhost/private/var/mobile/Applications/BE25F9B5-2D08-4B59-8B62-D04DF7BB7E5B/tmp/-Tmp-/capture-T0x108cb0.tmp.8M81HU/capturedvideo.MOV"; } NewFilename: /var/mobile/Applications/BE25F9B5-2D08-4B59-8B62-D04DF7BB7E5B/Documents/1274026741.mov [NSUr filesystem report]: 0x1c1f90 sent to unknown selector for example *** Exception exception to 'NSINIDADAgentException' Due to the end of the application, the reason: '- [NSUr File System Presentation]: 0x1c1f90 sent to the unknown selector for example  

I can follow you logic but a mauli The point is: This is not how to save video .

Please see a general example below without a relevant error check.

  (zero) imagePickerController: (UIImagePickerController *) picker didFinishPickingMediaWithInfo: (NSDictionary *) info {.... Here is the code ..... NSString * videoURL = [information objectForKey: UIImagePickerControllerMediaURL] ; // Remember to make sure that the video photo album is compatible to save UISaveVideoAtPathToSavedPhotosAlbum (videoURL, self, @selector (video: includingFinish Saving Enter: referenceInfo :)); .... here is the code .....}  

Comments