I have a non-moving array that should only have numbers. How should I initialize this?
I have it like below right now, but I think there should be a better way. Can we do it like in C ++? Something like this int list[5] = {1,2,3,4,5}; would affect the application?
myArray = [[NSArray alloc] initWithObjects: [NSNumber numberWithInt:1], [NSNumber numberWithInt:2], [NSNumber numberWithInt:3], nil];
Also, if I needed an array of arrays with only numbers, what would it look like? I am new to obj-c and looked around, I saw conflicting answers.
user1213042
source share