Is this the correct way to pop objects off the front of an array. I was just curious as I was thinking there might be a method for NSMutableArray that returned a retained object. Just curious if I am getting this right?
// PUTTING OBJECTS IN
NSMutableArray *fgStore = [[NSMutableArray alloc] init];
for(int counter=1; counter<=5; counter++) {
NSString *dataValue = [[NSString alloc] initWithFormat:@"DATA%d", counter];
[fgStore addObject:dataValue];
[dataValue release];
}
// TAKING OBJECTS OUT
NSString *saveMe = [[fgStore objectAtIndex:0] retain];
[fgStore removeObjectAtIndex:0];
NSLog(@"SAVE: %@", saveMe);
...
...
[fgStore release];
[saveMe release];
gary