Can someone show me how to retrieve values by looping through a NSMutableArray? My code, which basically adds integer numbers to the array, is below :
NSMutableArray *ptr = [[NSMutableArray alloc] init];
[ptr addObject:[NSNumber numberWithInt:1]];
[ptr addObject:[NSNumber numberWithInt:2]];
[ptr addObject:[NSNumber numberWithInt:3]];
// How to retrieve them as integers?
I’m trying to retrieve each number from the array and sum them up to a total value.
Its actually pretty simple: