开发者

when try to deserialize property List in to Object always getting null

this is my property list data in NSdata fotmat which i try to deserialize

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//开发者_C百科Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<Key>Secondfactor</Key>
<string>0</string>
</dict>
</array>
</plist>

NSArray *theArray=[NSPropertyListSerialization propertyListFromData:mResultData mutabilityOption:NSPropertyListImmutable format:NULL errorDescription:nil];

theArray is Always null


Have you tried passing and reading out an error string?

NSString *error;

[NSPropertyListSerialization propertyListFromData:mResultData mutabilityOption:NSPropertyListImmutable format:NULL errorDescription:&error];

if (error) {
    NSLog(@"error: %@", error);
    [error release];
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜