NSDictionary Vs. NSArray

I read on objective-c (ranch ranch book) and I can't help but think about this question: how can I decide which type of NSArray or NSDictionary collection (with or without their mutable subclasses) to use when reading content from a URL?

Say I'm reading JSON data from a PHP script (the script I'm dealing with) which to use? I know that many links indicate that it depends on the data structure (i.e. JSON), but can a clear outline of the two structures be outlined?

Thank you all for your help :)

+5
source share
3 answers

NSArray - , .
NSDictionary ( , NSStrings, , -).

JSON, URL-, NSJSONSerialization, Objective-C. JSON. JSON ( "["), NSArray. JSON ( "{"), NSDictionary.

+10

NSArray, , NSDictionary, .

, , person, name, a phone number email, .

, .

, .

.

+2

"withContentOfURL" "withContentOfFile" , URL- , Cocoa. JSON . , URL-, . NSArray, NSArray. NSDictionary, NSDictionary. .

0
source

All Articles