मैं फ़ाइलों को कॉपी करने की कोशिश कर रहा हूं जिन्हें मैं "शामिल" नामक फ़ोल्डर में जोड़ता हूं जिसे "निर्देशिका" भी कहा जाता है। मैं resContents शून्य मूल्य के लिए मिलता है। क्यूं कर? धन्यवादआईओएस प्रतिलिपि मुख्य बंडल से दस्तावेजों की निर्देशिका में
- (void)copyResources{
NSString *sourcePath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"includes"];
NSString *destPath = [[self applicationDocumentsDirectory] stringByAppendingPathComponent:@"includes"];
NSArray* resContents = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:sourcePath error:NULL];
for (NSString* obj in resContents){
NSError* error;
if (![[NSFileManager defaultManager] copyItemAtPath:[sourcePath stringByAppendingPathComponent:obj] toPath:[destPath stringByAppendingPathComponent:obj]
error:&error])
NSLog(@"Error: %@", error);;
}
}
महान, काम कर रहा है! धन्यवाद – Jaume