Mac App Storeでアプリを配布する場合、ファイルの保存に関する制限はありますか?
コンピューターからアプリをコンパイルして実行すると、正常に動作します。構成が保存されます。
ただし、MacAppStoreからダウンロードしたバージョンでは構成が保存されていません。設定ファイルすら表示されません。誰もが何が起こっているのか知っていますか?
これは、構成を保存するコードです。
-(void)saveConfig:(id)plist {
NSString *path = [[[NSBundle mainBundle] resourcePath] stringByAppendingString: CONFIG_FILE_NAME];
NSData *xmlData;
NSString *error;
xmlData = [NSPropertyListSerialization dataFromPropertyList: plist
format: NSPropertyListXMLFormat_v1_0
errorDescription: &error];
if(xmlData)
{
if (![xmlData writeToFile:path atomically:YES])
NSLog(@"Failed to write the config file onto the hard drive");
}
else
{
NSLog(error);
}
}