2
주어진 색인에 개체를 삽입하고 싶습니다. 인덱스에 개체가없는 경우이를 알고 싶습니다. NSDictionary가 좋은 선택입니까? 다른 좋은 해결책이 있습니까?iphone-sdk의 지정된 색인에 개체를 삽입하는 방법
// Initailization
NSMutableDictionary *items = [NSMutaleDictionary dictionary];
...
// insert an object.
[items setObject:item forKey:[NSNumber numberWithInt:3]];
...
// I want to know that there is an object at a given index.
item = [items objectForKey:[NSNumber numberWithInt:4]];
if (item)
// exist
else
// non exist