Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are data structures in Objective-C? [closed]

What are the data structures that we can use in Objective-C?

like image 909
sukumar Avatar asked Dec 05 '09 06:12

sukumar


2 Answers

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

like image 196
Dave DeLong Avatar answered Oct 03 '22 16:10

Dave DeLong


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.

like image 35
Seth Avatar answered Oct 03 '22 16:10

Seth