'arrayWithCapacity:listCount'에 해당되는 글 1건

  1. 2011.03.12 [iphone] NSMutableArray, arrayWithCapacity:listCount, nsmutable, nsmutablearray, array, nsarray
XCODE2011. 3. 12. 17:13

// 초기화 및 배열 넣기

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
Posted by 오늘마감

댓글을 달아 주세요