I've seen this, but there needs to be an easier way than that.
If I have an array of NSNumbers and I want to increment one of them, I have to do this?
[myMutableArray replaceObjectAtIndex:index withObject:[NSNumber numberWithInt:[(NSNumber *)[myMutableArray objectAtIndex:index] intValue] + 1]];
or
myArray = [myArray.mutableCopy replaceObjectAtIndex:index withObject:[NSNumber numberWithInt:[(NSNumber *)[myArray objectAtIndex:index] intValue] + 1]].copy;
if you decide to use an immutable array for some reason.
I know I could always just use an int array, but I was just curious if there was a simple way to do this.
Also, how should I define an int array if I need access to it either within an implementation or a full file (the entire .m) without making it global?
Would it just be as simple as throwing this at the top of my implementation / file?
static int *myInt;