Mam aplikację, w której mam folder o nazwie "Obrazy" w moim głównym pakiecie.Skopiuj folder z głównego pakietu do katalogu dokumentów w iphone
W folderze tym znajduje się inny folder o nazwie "Obrazy1" zawierający niektóre obrazy.
Po uruchomieniu aplikacji chcę mieć folder "Obrazy" w katalogu dokumentów.
Chcę pobrać obrazy z folderu "Images1".
Ale nie mogę dostać moje obrazy w folderze "Obrazy" w katalogu dokumentów z następującego kodu.
Edited
BOOL success1;
NSFileManager *fileManager1 = [NSFileManager defaultManager];
NSError *error1;
NSArray *paths1 = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory1 = [paths1 objectAtIndex:0];
NSString *writableDBPath1 = [documentsDirectory1 stringByAppendingPathComponent:@"Images/Images1"];
success1 = [fileManager fileExistsAtPath:writableDBPath1];
if (success1) return;
// The writable database does not exist, so copy the default to the appropriate location.
NSString *defaultDBPath1 = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"Images/Images1"];
NSLog(@"Default : %@",defaultDBPath1);
success1 = [fileManager1 copyItemAtPath:defaultDBPath1 toPath:writableDBPath1 error:&error1];
if (!success1) {
NSAssert1(0, @"Failed to create writable database file with message '%@'.", [error1 localizedDescription]);
}
Proszę mi pomóc.
Na marginesie: przygotować się do app store odrzucenia, ponieważ najprawdopodobniej narusza [wytyczne przechowywania danych] (http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide /PerformanceTuning/PerformanceTuning.html#//apple_ref/doc/uid/TP40007072-CH8-SW9). Nie należy zapisywać danych, które można łatwo odtworzyć w katalogu dokumentów. –