• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Total newbie struggling with NSMutableArray
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >Re: Total newbie struggling with NSMutableArray (From: Harilaos Skiadas <email@hidden>)

  • Prev by Date: Re: Total newbie struggling with NSMutableArray
  • Next by Date: Toolbar Item Label Refresh
  • Previous by thread: Re: Total newbie struggling with NSMutableArray
  • Next by thread: Font
  • Index(es):
    • Date
    • Thread