다음과 같이 반전 할 수 있습니다. 그러나 앱 번들로 복사 할 수 없습니다.앱 샌드 박스에서 앱 번들로 파일을 복사 할 수 있습니까?
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsPath = [paths objectAtIndex:0];
// Destination path
NSString *fileInDocumentsPath = [documentsPath stringByAppendingPathComponent:@"Passwords File.txt"];
// Origin path - used when file is in bundle
NSString *fileInBundlePath = [[NSBundle mainBundle] pathForResource:@"Passwords File" ofType:@"txt"];
// File manager for copying File in Bundle to Sandbox
NSError *error = nil;
NSFileManager *fileManager = [NSFileManager defaultManager];
[fileManager copyItemAtPath:fileInBundlePath toPath:fileInDocumentsPath error:&error];
번들 디렉토리에 쓰는 것이 허용되지 않습니다. 샌드 박스의 일부가 아닙니다. – Steveo
응용 프로그램 번들에 서명하고 파일을 추가합니다. 서명을 묻습니다. – AlexWien
번들 디렉토리는 응용 프로그램에 대해 읽기 전용입니다. –