Here's what I want to do:
NSRange r = NSMakeRange(0,5);
id a = [NSMutableArray a];
[a addObject: r]; // but NSRange is not a NSObject *
With a boolean, I'd use code like this:
[a addObject: [NSNumber numberWithBool: YES]];
or with an integer:
[a addObject: [NSNumber numberWithInteger: 3]];
So what's the equivalent with a NSRange...
I want to select some objects from an array. Therefore I'm using begin and end indexes of my selection.
NSLog(@"start:%d\nend:%d", startIndex, endIndex);
NSIndexSet *myIndexes = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(startIndex, endIndex)];
NSLog(@"%d", [myIndexes lastIndex]);
The first NSLog gives me
startIndex:49
...
In Objective C, when using the function NSIntersectionRange with one of the arguments being zero length, does the result equal the other argument? Didn't see this when I searched so I wanted to clarify it for others.
...