iOSPawan
iOSPawan

Reputation: 2894

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 "-//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

Upvotes: 0

Views: 170

Answers (1)

klaaspieter
klaaspieter

Reputation: 2665

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];
}

Upvotes: 1

Related Questions