[英]Iphone - > Copying images from bundle to documents folder takes TOO long
[英]iphone copying folder from bundle to documents
我最困難的是讓它工作。 我正在嘗試將文件夾從捆綁包復制到文檔目錄。
我要查找的文件夾在這里:
... app / Resources / 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:error:調用中使用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
它可能會說明原因。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.