mirror of
https://github.com/nickshanks/ResKnife.git
synced 2024-06-15 00:29:29 +00:00
Use block-based enumeration when targeting 10.6+.
This commit is contained in:
parent
559e3fa755
commit
46d52d6549
|
@ -12,15 +12,21 @@
|
|||
|
||||
- (NSArray *)selectedItems
|
||||
{
|
||||
NSMutableArray *items = [NSMutableArray array];
|
||||
NSMutableArray *items = [NSMutableArray array];
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3
|
||||
NSIndexSet *indicies = [self selectedRowIndexes];
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
|
||||
[indicies enumerateIndexesUsingBlock:^(NSUInteger idx, BOOL *stop) {
|
||||
[items addObject:[self itemAtRow:idx]];
|
||||
}];
|
||||
#else
|
||||
unsigned int rowIndex = [indicies firstIndex];
|
||||
while (rowIndex != NSNotFound)
|
||||
{
|
||||
[items addObject:[self itemAtRow:rowIndex]];
|
||||
rowIndex = [indicies indexGreaterThanIndex:rowIndex];
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
NSNumber *row;
|
||||
NSEnumerator *enumerator = [self selectedRowEnumerator];
|
||||
|
|
Loading…
Reference in New Issue
Block a user