How to move video from application documents directory to camera roll?

后端 未结 1 1453
别跟我提以往
别跟我提以往 2021-02-11 08:36

hallo,

i have found some iphone-camera-video-saving avfoundation code examples over the net (and also im tryin to write my own code but not finished it yet)

su

相关标签:
1条回答
  • 2021-02-11 09:03

    Transfer to Camera Roll - here's a link that should help.

    To see what's in your Documents directory, here's a code snippet:

     -(void) dump {
    
        NSString *docsDir = [NSHomeDirectory() stringByAppendingPathComponent:  @"Documents"];
        NSFileManager *localFileManager = [NSFileManager defaultManager];
        NSDirectoryEnumerator *dirEnum =
            [localFileManager enumeratorAtPath:docsDir];
        NSError *error=nil;
    
        NSLog(@" Documents Directory: %@", docsDir);
        NSString *file;
        while (file = [dirEnum nextObject]) {
            NSString *fullPath = [NSString stringWithFormat:@"%@/%@", docsDir,file];
            NSDictionary *attrs = [localFileManager attributesOfItemAtPath:fullPath error:&error];
            if ( error ) {
                NSLog(@" error - %@", error);
            } else {
              //NSLog(@" file : %@", file);
              NSInteger fsiz = [attrs fileSize];
              NSString *ftyp = [attrs fileType];
              NSDate   *fmod = [attrs fileModificationDate];
              NSLog(@"  %9d : %@ : %@ : %@",  fsiz, file, ftyp, fmod );
             }
         }
        NSLog(@" ======  End Documents Directory ========");
       }
    
    0 讨论(0)
提交回复
热议问题