in PHP when using an array you can use myArray['firstElement'] to pull that specific key and its associated values from the array. How do I do this similar type of thing in objective c?
If you want to deal with key-value pairs, you would use an NSDictionary
.
Although it is surprising to note that arrays in PHP are an ordered map
.
You want to use NSDictionary instead of NSArray. NSDictionary is an associative array.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.