mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
Add new methods for NSIndexPath. Add row, section, item and new init methods
This commit is contained in:
parent
ae72ee4593
commit
95a24fb651
2 changed files with 28 additions and 1 deletions
|
@ -74,6 +74,16 @@ static NSIndexPath *dummy = nil;
|
|||
return [self indexPathWithIndexes: idxs length: 2];
|
||||
}
|
||||
|
||||
+ (NSIndexPath *) indexPathForRow: (NSInteger)row inSection: (NSInteger)section;
|
||||
{
|
||||
NSUInteger idxs[2];
|
||||
|
||||
idxs[0] = (NSUInteger)section;
|
||||
idxs[1] = (NSUInteger)row;
|
||||
|
||||
return [self indexPathWithIndexes: idxs length: 2];
|
||||
}
|
||||
|
||||
+ (void) initialize
|
||||
{
|
||||
if (empty == nil)
|
||||
|
@ -208,6 +218,11 @@ static NSIndexPath *dummy = nil;
|
|||
}
|
||||
}
|
||||
|
||||
- (NSInteger) row
|
||||
{
|
||||
return (NSInteger)[self indexAtPosition: 1];
|
||||
}
|
||||
|
||||
- (NSInteger) item
|
||||
{
|
||||
return (NSInteger)[self indexAtPosition: 1];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue