开发者

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

开发者 https://www.devze.com 2022-12-13 12:18 出处:网络
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on 开发者_如何学Goone problem only b
Closed. This question needs to be more focused. It is not currently accepting answers.

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 question

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.


The following documents may help:

  • The Objective-C Programming Language
  • Cocoa Fundamentals Guide
0

精彩评论

暂无评论...
验证码 换一张
取 消