It should be pretty simple, but I was wondering how to add an integer to an array?
I know that I can add lines as follows:
NSMutableArray *trArray = [[NSMutableArray alloc] init];
[trArray addObject:@"0"];
[trArray addObject:@"1"];
[trArray addObject:@"2"];
[trArray addObject:@"3"];
But I think I can’t just add integers:
NSMutableArray *trArray = [[NSMutableArray alloc] init];
[trArray addObject:0];
[trArray addObject:1];
[trArray addObject:2];
[trArray addObject:3];
At least the compiler is not happy with this and tells me that I am doing cast without saying so.
Any explanation would be much appreciated.
source
share