Я пытался создать новый файл в моей папке поддержки приложений при использовании NSApplicationSupportDirectory;Я могу записать в него файл, но мне не удалось создать папку внутри службы поддержки приложений.
NSArray *paths = NSSearchPathForDirectoriesInDomains
(NSApplicationSupportDirectory, NSUserDomainMask, YES);
NSString *applicationDirectory = [paths objectAtIndex:0];
//make a file name to write the data to using the application support: (attempting to create the blasted directory inside of application support directory
NSString *fileName = [NSString stringWithFormat:@"%@/managersemail.txt",
applicationDirectory];
//create content - formats with the managersemail.txt location
NSString* content = [NSString stringWithFormat:@"%@",[nameField stringValue]];
//save content to the documents directory
[content writeToFile:fileName
atomically:NO
encoding:NSStringEncodingConversionAllowLossy
error:nil];
NSDictionary* errorDict;
Код, который я перечислил выше, прекрасно работает, за исключением части о создании папки, в которую я хочу поместить managersemail.txt.Я попытался имитировать строку stringWithFormat, которая указана в содержимом NSString *, и затем менял ее несколькими способами, но безрезультатно!Есть мысли?
NSAppleEventDescriptor* returnDescriptor = NULL;