my code is this. And the value of ret is always NO, I think the write path is not allowed. But where I can store my information on MAC OS X for my app? Can you help me to find the right path to store my app's setting? Thank you very much~ :)
NSString* writePath = [[[NSBundle mainBundle] resourcePath]
stringByAppendingPathComponent:@"Brain.plist"];
NSLog(@"%@",writePath);
NSMutableDictionary* dictForRet = [[NSMutableDictionary alloc]init];
NSNumber* applicationNumber = [[NSNumber alloc]initWithInt:0];
NSMutableDictionary* root = [[NSMutableDictionary alloc]init];
NSArray* propertyArray = [[NSArray alloc]initWithObjects:kPropertyArrayApplicationPath,kPropertyArrayApplicationCS, nil];
NSMutableDictionary* brain = [[NSMutableDictionary alloc]init];
[root setObject:propertyArray forKey:kPropertyArrayName];
[dictForRet setObject:applicationNumber forKey:kPropertyKeyApplicationNumber];
[dictForRet setObject:root forKey:kPropertyArrayDictName];
[dictForRet setObject:brain forKey:kPropertyDictBrainName];
NSLog(@"%@",dictForRet);
ret = [dictForRet writeToFile:writePath atomically:YES];
NSLog(@"%d",ret);