What 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With