0
我有這段代碼,它將plist文件複製到users文件夾中的ApplicationSupport目錄。將Plist文件複製到ApplicationSupport(Objective-C)中的自定義文件夾中
NSString *resourcePath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:kAutonumberPlist];
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES);
NSString *dataPath = [[paths objectAtIndex:0] stringByAppendingPathComponent:kAutonumberPlist];
NSFileManager *fileManager = [NSFileManager defaultManager];
if (![fileManager fileExistsAtPath:dataPath]) {
[fileManager copyItemAtPath:resourcePath toPath:dataPath error:nil];
}
如何CA改變它,這樣,而不是將文件複製到〜用戶/庫/ ApplicationSupport,將其複製到〜用戶/庫/ ApplicationSupport/AnotherFolder。 「AnotherFolder」已經存在了。
謝謝!
謝謝您的幫助! – Michael