I would like to try the wisdom of the crowd ... because now I'm upset. Thanks in advance.
So here is my code:
- (void)imagePickerController:(UIImagePickerController *)ipc didFinishPickingMediaWithInfo:(NSDictionary *)info{
NSLog (@ "info:% @", info);
NSString * newFilename = [NSString stringWithFormat: @ "% @ /% @. Mov", [NSHomeDirectory () stringByAppendingPathComponent: @ "Documents"], [NSString stringWithFormat: @ "% d", (long) [[NSDate date] timeIntervalSince1970 ]]];
NSLog (@ "newFilename:% @", newFilename);
NSFileManager * filemgr = [NSFileManager defaultManager];
NSError * err; if ([filemgr copyItemAtPath: [info objectForKey: @ "UIImagePickerControllerMediaURL"] toPath: newFilename error: & err] == YES) NSLog (@ "Move successfully"); another NSLog (@ "Move failed");
and this is the log:
2010-05-16 18:19:01.975 erlkoenig[7099:307] info: {
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
[NSURL fileSystemRepresentation]: unrecognized selector sent to instance 0x1c1f90
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSURL fileSystemRepresentation]: unrecognized selector sent to instance 0x1c1f90
source
share