Re: how to combine addObject in mutablearray with Object instantiation?

2009-05-05 Thread Michael Ash
On Tue, May 5, 2009 at 2:05 AM, Weydson Lima wrote: > Sorry for jumping in, but I have a question in the following line: > >> For other objects, you'll have to use a convenience method like: >> >>        [myArray addObject:[NSNumber numberWithInt:7]]; >> > > When you add a NSNumber object, how can

Re: how to combine addObject in mutablearray with Object instantiation?

2009-05-04 Thread Graham Cox
On 05/05/2009, at 4:05 PM, Weydson Lima wrote: If you use indexOfObject:[NSNumber numberWithInt:7] that wouldn't work, right? D'oh. Engage brain... Yes, this would work, because objects are compared using -isEqual: I read that as -objectAtIndex:, not -indexOfObject: --Graham ___

Re: how to combine addObject in mutablearray with Object instantiation?

2009-05-04 Thread Graham Cox
On 05/05/2009, at 4:05 PM, Weydson Lima wrote: When you add a NSNumber object, how can you quickly reference back to it? Let's say you want to find the index in the array of the object you just created. If you use indexOfObject:[NSNumber numberWithInt:7] that wouldn't work, right? No it

Re: how to combine addObject in mutablearray with Object instantiation?

2009-05-04 Thread Weydson Lima
Oops, wrong list :) On Tue, May 5, 2009 at 1:05 AM, Weydson Lima wrote: > Sorry for jumping in, but I have a question in the following line: > >> For other objects, you'll have to use a convenience method like: >> >>[myArray addObject:[NSNumber numberWithInt:7]]; >> > > When you add a NS

Re: how to combine addObject in mutablearray with Object instantiation?

2009-05-04 Thread Weydson Lima
Sorry for jumping in, but I have a question in the following line: > For other objects, you'll have to use a convenience method like: > >[myArray addObject:[NSNumber numberWithInt:7]]; > When you add a NSNumber object, how can you quickly reference back to it? Let's say you want to find t