Re: objects aren't added to NSMutableArray

2008-06-17 Thread Adam R. Maxwell
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

Re: objects aren't added to NSMutableArray

2008-06-17 Thread Jens Alfke
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

Re: objects aren't added to NSMutableArray

2008-06-17 Thread James Walker
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

Re: objects aren't added to NSMutableArray [solved]

2008-06-17 Thread Daniel Richman
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

Re: objects aren't added to NSMutableArray

2008-06-17 Thread Robert Kukuchka
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

objects aren't added to NSMutableArray

2008-06-17 Thread Daniel Richman
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