// 초기화 및 배열 넣기
NSMutableArray *arrayData;
arrayData = [NSMutableArray arrayWithCapacity:listCount];
NSString *strData = @"아이폰";
[arrayData addObject:[NSString stringWithFormat:@"%@",strData]];
// Dic 배열에 넣기
NSMutableDictionary *item = [[NSMutableDictionary alloc] init];
[item setObject:[arrToken objectAtIndex:0] forKey:@"date"];
[item setObject:[arrToken objectAtIndex:1] forKey:@"price"];
[arrayData addObject:[item copy]];
// Method
-
addObject:
Adds the given object to the end of the array.
-
insertObject:atIndex:
Inserts the given object at index, moving the object there previously, and all objects at higher indices, one along.
-
removeObject:
Removes all instances of an object in the array
-
removeObjectAtIndex:
Removes the object at the given index.
-
replaceObjectAtIndex:withObject:
Replaces the object at index with the one supplied. Returns an error if the index is out of bounds.
-
sortUsingSelector:
Sorts an array; see SortUsingSelector
-
removeObjectIdenticalTo:
checks for object identity before removing an object; see NSMutableArrayRemoveObjectIdenticalTo for an example of when this is necessary
출처 : http://blog.naver.com/PostView.nhn?blogId=hana_815&logNo=60112995891
'XCODE' 카테고리의 다른 글
| [OSX] Xcode 에서 __MyCompanyName__ 수정하는 방법 (0) | 2011/04/09 |
|---|---|
| [iphone] xcode, uninstall, 언인스톨, 삭제, 제거 (0) | 2011/04/09 |
| [iphone] NSMutableArray, arrayWithCapacity:listCount, nsmutable, nsmutablearray, array, nsarray (0) | 2011/03/12 |
| NSMutableArray Deep Copy 방법 (0) | 2011/03/12 |
| [아이폰 앱 개발] customcell사용시 메모리효율적이용, 즉 재사용시키려면 해야할 것. (0) | 2010/11/07 |
| [아이폰 앱 개발] cancel alert (0) | 2010/11/06 |