Re: Total newbie struggling with NSMutableArray
Re: Total newbie struggling with NSMutableArray
- Subject: Re: Total newbie struggling with NSMutableArray
- From: John Hopkins <email@hidden>
- Date: Fri, 25 Feb 2005 15:10:38 +0000
Hi guys,
Wow, I think that just goes to show my newbieness! It seems to work
fine now that I know you have to have an init method! Seems very
obvious now that I think about it.
Thanks for your help, now hopefully onwards and upwards.
See you guys around.
John
On 25 Feb 2005, at 14:54, Harilaos Skiadas wrote:
- (IBAction)surName:(id)sender
{
[array addObject:@"hopkins"];
[display setStringValue:[array objectsAtIndex:1]];
}
@end
In case this isn't a typo, you probably want
objectAtIndex in the above part, not objectsAtIndex.
Of course, allocating the array is the main problem,
since otherwise you would be seeing a message saying
that NSMutableArray doesn't respond to selector
objectsAtIndex:. Since you are not seeing this
message, it means, as others already pointed out, that
you have nil instead of array over there when the
thing actually runs, since you never allocated and
inited the array.
HTH,
Haris
__________________________________
Do you Yahoo!?
Yahoo! Mail - Easier than ever with enhanced search. Learn more.
http://info.mail.yahoo.com/mail_250
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden