iphone将文件夹从文件夹复制到文档

问题描述:

我正在最困难的时间才能正常工作。我试图将我的包中的文件夹复制到文档目录。iphone将文件夹从文件夹复制到文档

我试图找到该文件夹​​是在这里:

...应用程序/资源/ 12 /(一堆的JPG文件的)

NSString *myPath = [[[NSBundle mainBundle] resourcePath]stringByAppendingPathComponent:@"12"]; 
NSLog(@"%@",myPath);/// returns "..../MyApp.app/12" 

NSArray *arrayOf12s = [[NSFileManager defaultManager]contentsOfDirectoryAtPath:myPath error:nil]; 

NSLog(@"%@",arrayOf12s);  ////always returns NULL 

如何在-contentsOfDirectoryAtPath使用NSError参数:错误:打电话?

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 

它可能照到造成一定的光...

+0

一切都是为了给是:错误:操作无法完成。 (可可错误260.) – Brodie 2010-10-29 16:52:40

+0

什么是'resourceDBFolderPath'设置为? – westsider 2010-10-29 17:02:02

+0

另外,你见过这个?它可能有助于将整个目录包含到应用程序包中 - 而不仅仅是目录的内容。 – westsider 2010-10-29 17:08:04