Re: Total newbie struggling with NSMutableArray
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