mirror of
https://github.com/nickshanks/ResKnife.git
synced 2024-08-31 19:29:11 +00:00
25 lines
558 B
Objective-C
25 lines
558 B
Objective-C
#import "NSOutlineView-SelectedItems.h"
|
|
|
|
/* The methods in the following catagory were taken from OmniAppKit */
|
|
|
|
@implementation NSOutlineView (SelectedItems)
|
|
|
|
- (id)selectedItem
|
|
{
|
|
if( [self numberOfSelectedRows] != 1 ) return nil;
|
|
else return [self itemAtRow:[self selectedRow]];
|
|
}
|
|
|
|
- (NSArray *)selectedItems;
|
|
{
|
|
NSNumber *row;
|
|
NSMutableArray *items = [NSMutableArray array];
|
|
NSEnumerator *enumerator = [self selectedRowEnumerator];
|
|
|
|
while( row = [enumerator nextObject] )
|
|
[items addObject:[self itemAtRow:[row intValue]]];
|
|
|
|
return items;
|
|
}
|
|
|
|
@end |