0
我有一個字典稱爲根辭典和使用在對propertyList seralization我只是將它轉換成XML格式除去從XML由nspropertyllist seralization產生的標籤
id plist = [NSPropertyListSerialization dataFromPropertyList:(id)rootObj
format:NSPropertyListXMLFormat_v1_0 errorDescription:nil];
NSString *plistString = [[NSString alloc] initWithData:plist encoding:NSUTF8StringEncoding];
NSLog(@"the plist is: %@", plistString);
和出放是如下
2011-08-21 23:32:49.324 so7143762iPhone[5474:207] the plist is: <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Lincoln</key>
<dict>
<key>DOB</key>
<date>1809-02-12T09:18:00Z</date>
<key>Name</key>
<string>Abraham Lincoln</string>
<key>Scores</key>
<array>
<integer>8</integer>
<real>4.9000000953674316</real>
<integer>9</integer>
</array>
</dict>
<key>Washington</key>
<dict>
<key>DOB</key>
<date>1732-02-17T01:32:00Z</date>
<key>Name</key>
<string>George Washington</string>
<key>Scores</key>
<array>
<integer>6</integer>
<real>4.5999999046325684</real>
<integer>6</integer>
</array>
</dict>
</dict>
</plist>
,但我不希望顯示
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
任何一個可以請告訴我,是有可能與否,如果有可能,請告訴我該怎麼做....提前
感謝......
使用總是使用字符串替換方法嗎? – Devraj