NSArrayController selectionIndex should return NSNotFound when there is no selection

This commit is contained in:
Airy ANDRE 2012-02-20 20:01:22 +01:00
parent 9a5c9ba947
commit b3026a2231

View File

@ -292,7 +292,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
-(NSUInteger)selectionIndex
{
return [_selectionIndexes firstIndex];
if (_selectionIndexes == nil) {
return NSNotFound;
} else {
return [_selectionIndexes firstIndex];
}
}
-(BOOL)setSelectionIndex:(unsigned)index