Iritscen
Mr. Grumpikins
I am simply trying to do this:
Hopefully the above code, reconstructed from memory since I'm not at my Mac, will give the result that nothing is added to the array, because that's what's happening in my program. Am I supposed to be using the retain command somewhere? I feel like I'm missing a basic piece of knowledge about Obj-C.
In the past, I have eventually gotten this kind of thing to work by diddling around with it. Looking at some code I wrote three years ago, I got all kinds of numbers within arrays within arrays working just fine, and yet I can't see why it works and this doesn't. Frustrating.
Code:
NSMutableArray *ray;
[ray initWithCapacity:5]; // or whatever number
NSNumber *q;
[q initWithInt:8];
[ray addObject:q];
Hopefully the above code, reconstructed from memory since I'm not at my Mac, will give the result that nothing is added to the array, because that's what's happening in my program. Am I supposed to be using the retain command somewhere? I feel like I'm missing a basic piece of knowledge about Obj-C.
In the past, I have eventually gotten this kind of thing to work by diddling around with it. Looking at some code I wrote three years ago, I got all kinds of numbers within arrays within arrays working just fine, and yet I can't see why it works and this doesn't. Frustrating.