I have a problem with my Xcode app, When I push a button, my app crashes.
Here is my button's action, I also declared variables, strings, etc... but it isn't in this code:
{
NSLog(@" - Writing Data.plist Labels");
NSString *error;
NSString *rootPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
NSString *plistPath = [rootPath stringByAppendingPathComponent:@"Data.plist"];
NSDictionary *plistDict = [NSDictionary dictionaryWithObjects:
[NSArray arrayWithObjects: compteur01, compteur02, compteur03, compteur04, compteur05, compteur06, nil]
forKeys:[NSArray arrayWithObjects: @"name1", @"name2", @"name3", @"name4", @"name5", @"name6", nil]];
NSData *plistData = [NSPropertyListSerialization dataFromPropertyList:plistDict
format:NSPropertyListXMLFormat_v1_0
errorDescription:&error];
if(plistData) {
[plistData writeToFile:plistPath atomically:YES];
}
else {
NSLog(@"Error writeToFile:plistData:labels");
[error release];
}
}