i have a bit frustated problem here, The problem is I want to copy a directory from Bundle into Library path in my app, but the code can't do that. The tree of the directory is showing here :
before I copy the directory, i wanna check the directory contents in bundle, but the array return 0 item. The code i use is this :
NSString * templatesBundlePath = [[NSBundle mainBundle] pathForResource:@"Templates" ofType:nil];
NSArray * packFolders = [[NSFileManager defaultManager] contentsOfDirectoryAtURL:[NSURL fileURLWithPath:templatesBundlePath] includingPropertiesForKeys:[NSArray arrayWithObjects:NSURLIsDirectoryKey, nil] options:0 error:&error];
the packfolders contain 0 item.
and if the contain is not 0 I try to copy it with this code :
NSString * templatesAppPath = NSApplicationSupportDirectoryPath(@"Templates");
[[NSFileManager defaultManager] copyItemAtPath:templatesBundlePath toPath:templatesAppPath error:&error];
when i try to check the bundle directory size with this code
NSFileManager *fm = [[NSFileManager alloc] init];
resultSize = [[[fm attributesOfItemAtPath:[[NSURL fileURLWithPath:templatesBundlePath] path] error:nil] objectForKey:NSFileSize] unsignedIntegerValue];
NSLog(@"Size: %lu", (unsigned long)resultSize);
the value only show 68, but the real size in finder is 200MB
is there somebody who has a problem like mine? can somebody help me?
thank you