iphone copying folder from bundle to documents

前端 未结 1 1054
终归单人心
终归单人心 2020-12-12 07:54

I\'m having the hardest time getting this to work. I\'m trying to copy a folder from my bundle to the documents directory.

the folder I\'m trying to find is here:

相关标签:
1条回答
  • 2020-12-12 08:13

    How about using the NSError argument in -contentsOfDirectoryAtPath:error: call?

    NSString *myPath = [[[NSBundle mainBundle] resourcePath]stringByAppendingPathComponent:@"12"];
    NSLog(@"%@",myPath);/// returns "..../MyApp/12"
    
    NSError *error = nil;
    NSArray *arrayOf12s = [[NSFileManager defaultManager]contentsOfDirectoryAtPath:resourceDBFolderPath error:&error];
    
    if (error)
       NSLog(@"Error: %@", [error localizedDescription]);
    
    NSLog(@"%@",arrayOf12s);     ////always returns NULL
    

    It might shine some light on the cause...

    0 讨论(0)
提交回复
热议问题