What are data structures in Objective-C? [closed]
Want to improve this question? Update the question so it focuses on 开发者_如何学Goone problem only by editing this post.
Closed 8 years ago.
Improve this questionWhat are the data structures that we can use in Objective-C?
NSArray
is your standard array structure.
NSDictionary
is a key-value "hash map"
NSSet
is an unordered collection of unique objects.
Each of these is immutable (ie, once you create them, you can't change them). If you need to modify them dynamically, then you'll use their mutable subclasses: NSMutableArray
, NSMutableSet
, etc.
For structures beyond this, check out the CHDataStructures framework, which has queues, stacks, trees, treaps, and a whole lot more: http://cocoaheads.byu.edu/code/chdatastructures
Objective-C is C, so it supports struct
and the familiar C-language data types like int and char.
In addition there are special Objective-C classes.
You might want to take a look at Apple's Objective-C book.
The following documents may help:
- The Objective-C Programming Language
- Cocoa Fundamentals Guide
精彩评论