Need to convert NSData to NSArray

前端 未结 2 791
天涯浪人
天涯浪人 2020-12-11 22:52

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

2条回答
  •  猫巷女王i
    2020-12-11 23:18

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

提交回复
热议问题