의 데이터에 액세스 않는 NSMutableIndexSet의 : 나는 배열에 int 형과 인덱스와 같은 속성 인덱스 (2)의 수를 설정하는 방법어떻게 내가 가지고 NSMutableIndexSet
<NSMutableIndexSet: 0x85825c0>[number of indexes: 2 (in 2 ranges), indexes: (2 4)]
(2 4)
의 데이터에 액세스 않는 NSMutableIndexSet의 : 나는 배열에 int 형과 인덱스와 같은 속성 인덱스 (2)의 수를 설정하는 방법어떻게 내가 가지고 NSMutableIndexSet
<NSMutableIndexSet: 0x85825c0>[number of indexes: 2 (in 2 ranges), indexes: (2 4)]
(2 4)
count
메서드를 사용하면 집합의 인덱스 수를 얻을 수 있습니다. enumerateIndexesUsingBlock:
와 당신은 세트의 모든 인덱스를 열거하고 NSMutableArray
에 그들에게 를 추가 할 수 있습니다 H2CO3 @
NSUInteger numberOfIndexes = [set count];
NSMutableArray *array = [NSMutableArray array];
[set enumerateIndexesUsingBlock:^(NSUInteger idx, BOOL *stop) {
[array addObject:@(idx)];
}];
NSLog(@"%@", array);
은 당신이 나를 어떻게이 일을 알려주는 설명서에 보여주세요 수 있습니까? – BluGeni
나는 이것을 (Apple에 의한 공식 클래스 참조) 의미한다 : [링크] (https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSMutableIndexSet_Class/Reference/Reference.html) –
그렇습니다.하지만 마틴이 보여준 것처럼 enumerateIndexUsingBlock을 사용하여 인덱스의 데이터에 액세스하는 방법에 대한 설명서는 어디에 있습니까? – BluGeni