I’m using NSJSONSerialization JSONObjectWithData:options:error: in an iOS 5 project to read a JSON string and convert it to a Foundation object. Is there an easy way to find out if the object or some of its children are arrays, dictionaries, numbers or strings?
I’m using NSJSONSerialization JSONObjectWithData:options:error: in an iOS 5 project to read a JSON string
Share
You can check to see if the returned object is a certain class with the
-isKindOfClass:method. For example, to check if it’s an array:Similarly for the other foundation types.