Property list invalid for format
Property list invalid for format
- Subject: Property list invalid for format
- From: Daniel Todd Currie <email@hidden>
- Date: Sat, 1 Nov 2003 01:43:35 -0800
I have the following method for writing to an XML file:
- (void)updatePref:(NSDictionary *)tempDict
{
NSLog(@"%@", tempDict);
NSString *error;
NSData *prefData = [NSPropertyListSerialization
dataFromPropertyList:tempDict format:NSPropertyListXMLFormat_v1_0
errorDescription:&error];
if (!prefData)
{
NSLog(error);
[error release];
}
else
{
[prefData writeToFile:[plistPath stringByExpandingTildeInPath]
atomically:YES];
}
[...]
}
This method works in all of the places it is used, except for a
particular NSDictionary. The output of the above NSLogs for the
offending NSDictionary are as follows:
2003-11-01 00:48:04.958 TestApp[3848] <CFDictionary 0x3ab470
[0xa01900e0]>{type = mutable, count = 3, capacity = 4, pairs = (
0 : <CFString 0xaf0a4 [0xa01900e0]>{contents = "targets"} =
<CFDictionary 0x3b5d40 [0xa01900e0]>{type = immutable, count = 1,
capacity = 1, pairs = (
0 : <CFNumber 0x383760 [0xa01900e0]>{value = +0, type =
kCFNumberSInt32Type} = <CFDictionary 0x39b4d0 [0xa01900e0]>{type =
immutable, count = 5, capacity = 5, pairs = (
3 : <CFString 0xaf064 [0xa01900e0]>{contents = "targetPeriod"} =
<CFNumber 0x363fb0 [0xa01900e0]>{value = +12, type =
kCFNumberSInt32Type}
4 : <CFString 0xaf094 [0xa01900e0]>{contents = "targetLastDate"} =
<CFString 0x39bb30 [0xa01900e0]>{contents = "n/a"}
8 : <CFString 0xaf074 [0xa01900e0]>{contents = "periodUnit"} =
<CFString 0x39cbc0 [0xa01900e0]>{contents = "hours"}
9 : <CFString 0xaf084 [0xa01900e0]>{contents = "targetOverwrite"} =
<CFBoolean 0xa0190b98 [0xa01900e0]>{value = false}
10 : <CFString 0xaf054 [0xa01900e0]>{contents = "targetName"} =
<CFString 0x383830 [0xa01900e0]>{contents = "~/Documents"}
)}
)}
3 : <CFString 0x359eb0 [0xa01900e0]>{contents = "startWarned"} =
<CFBoolean 0xa0190b90 [0xa01900e0]>{value = true}
4 : <CFString 0xaf1a4 [0xa01900e0]>{contents = "archiveDir"} =
<CFString 0x3835a0 [0xa01900e0]>{contents = "~/Documents/Archives"}
)}
2003-11-01 00:48:04.958 TestApp[3848] Property list invalid for format
As you can see, the NSDictionary is made up entirely of legitimate
object types for plists... I have tried a number of things, and I have
all but given up. Thanks to those of you who put in an effort to
understand the problem (sorry for sending all this crunky output).
// Daniel Currie
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.