views:

1034

answers:

1

I am pulling down a plist from a URL using an NSURLConnection, which returns an NSData object. I would like to convert this to an NSArray. Can anyone help me?

I am refactoring a method that currently does a synchronous request to the URL, using arrayWithContentsOfURL: to get the NSArray.

Thanks!!

+2  A: 

Use +[NSPropertyListSerialization dataWithPropertyList:format:options:error:] to convert the data, then check if the result -isKindOfClass:[NSArray class].

KennyTM
Thanks, Kenny. I will try that.
Jacko