On Jun 17, 2008, at 8:16 PM, Jens Alfke wrote:
On 17 Jun '08, at 5:02 PM, Daniel Richman wrote:
I get no error, but the object isn't added. If I try to do
[myArray objectAtIndex:0];
I get (null)
That's a tip-off that the array pointer is nil, by the way — -
objectAtIndex: *never* returns
On 17 Jun '08, at 5:02 PM, Daniel Richman wrote:
I get no error, but the object isn't added. If I try to do
[myArray objectAtIndex:0];
I get (null)
That's a tip-off that the array pointer is nil, by the way — -
objectAtIndex: *never* returns nil, because it's not legal to store
nil values
Daniel Richman wrote:
I've got an object which has an NSMutableArray as an instance variable.
If, in one of my methods, I try to call
[myArray addObject:@"this is a test"]; (for example),
I get no error, but the object isn't added. If I try to do
[myArray objectAtIndex:0];
I get (null), a
Makes perfect sense. I hadn't thought about that since I've been doing a
lot of Interface Builder work recently, and of course those objects get
allocated and initialized automatically.
Thanks.
Robert Kukuchka wrote:
You're not calling [[numbers alloc] init];
at the point when you try to ad
You're not calling [[numbers alloc] init];
at the point when you try to addObject you're sending a message to
nil, which is acceptable under Objective-C
On 17-Jun-08, at 5:02 PM, Daniel Richman wrote:
I've got an object which has an NSMutableArray as an instance
variable. If, in one of my m
I've got an object which has an NSMutableArray as an instance variable.
If, in one of my methods, I try to call
[myArray addObject:@"this is a test"]; (for example),
I get no error, but the object isn't added. If I try to do
[myArray objectAtIndex:0];
I get (null), and
[myArray count];
ret