Ey guys, I am having trouble adding an NSDate object to an NSMutableArray and print out its counter. Here is what I have:
This is what I get from the console:
I have spent the last hour googling to no success. So I was wondering if anyone here may be able to help me. After I get the counter storing values I would like to be able to iterate through the array and print each value it holds. Here is the code I have for doing that:
Does that look good to you guys? No I do not care about what order it prints out in. Thanks in advance!
Code:
NSDate *curTime = [[NSDate alloc] init];
NSMutableArray *arrayOfTimes;
arrayOfTimes = [[NSMutableArray alloc] init];
NSUInteger *counter;
counter = [arrayOfTimes count];
NSLog(@"counter: %@",counter);
Code:
2009-11-11 04:09:34.855 WTC[81711:20b] counter: (null)
Code:
while (counter > 0) {
id item = [arrayOfTimes objectAtIndex:counter];
NSLog(@"NSDate: %@",item);
counter--;
}