Corrected errors when selecting expressions
This commit is contained in:
@@ -10,6 +10,11 @@
|
||||
|
||||
@implementation NSIndexPath (MPAdditions)
|
||||
|
||||
- (NSUInteger)firstIndex
|
||||
{
|
||||
return [self indexAtPosition:0];
|
||||
}
|
||||
|
||||
- (NSUInteger)lastIndex
|
||||
{
|
||||
return [self indexAtPosition:self.length-1];
|
||||
@@ -58,7 +63,7 @@
|
||||
return [[self indexPathByRemovingLastIndex] indexPathByAddingIndex:lastIndex];
|
||||
}
|
||||
|
||||
- (NSIndexPath *)indexPathWithLength:(NSUInteger)length
|
||||
- (NSIndexPath *)indexPathByRemovingIndexesFrom:(NSUInteger)length
|
||||
{
|
||||
NSIndexPath *indexPath = [[NSIndexPath alloc] init];
|
||||
for (NSUInteger position = 0; position < length; position++) {
|
||||
@@ -67,6 +72,15 @@
|
||||
return indexPath;
|
||||
}
|
||||
|
||||
- (NSIndexPath *)indexPathByRemovingIndexesTo:(NSUInteger)length
|
||||
{
|
||||
NSIndexPath *indexPath = [[NSIndexPath alloc] init];
|
||||
for (NSUInteger position = length; position < self.length; position++) {
|
||||
indexPath = [indexPath indexPathByAddingIndex:[self indexAtPosition:position]];
|
||||
}
|
||||
return indexPath;
|
||||
}
|
||||
|
||||
- (NSIndexPath *)commonIndexPathWith:(NSIndexPath *)indexPath
|
||||
{
|
||||
NSIndexPath *commonPath = [[NSIndexPath alloc] init];
|
||||
|
||||
Reference in New Issue
Block a user