• 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: j o a r <email@hidden>
  • Date: Fri, 25 Feb 2005 15:10:51 +0100


On 2005-02-25, at 14.45, John Hopkins wrote:

2005-02-25 13:39:42.119 NSMutableArray[3957] Invalid parameter not satisfying: aString != nil

You never create the array, so this:

	[display setStringValue: [array objectsAtIndex: 1]];

is actually the same as this:

	[display setStringValue: [nil objectsAtIndex: 1]];

which in turn is the same thing as:

	[display setStringValue: nil];

You need to create the array somewhere. Perhaps in the init method of your object, something like this:

	- (id) init
	{
		if ((self = [super init]) != nil)
		{
			array = [[NSMutableArray alloc] init];
		}

		return self;
	}

...and don't forget to remove it:

	- (void) dealloc
	{
		[array release];

		[super dealloc];
	}

j o a r

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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: 
 >Total newbie struggling with NSMutableArray (From: John Hopkins <email@hidden>)

  • Prev by Date: Total newbie struggling with NSMutableArray
  • Next by Date: Re: Total newbie struggling with NSMutableArray
  • Previous by thread: Total newbie struggling with NSMutableArray
  • Next by thread: Re: Total newbie struggling with NSMutableArray
  • Index(es):
    • Date
    • Thread