Re: Method not seeing array as array
Re: Method not seeing array as array
- Subject: Re: Method not seeing array as array
- From: Marco Scheurer <email@hidden>
- Date: Wed, 2 Feb 2005 22:08:44 +0100
The standard pattern for an initialization is:
- (id)init
{
self = [super init]; // <-- note that we're initializing `self'
here!
if(!self) return nil;
// initialize variables, etc
return self;
}
I don't know what exactly happens if you don't initialize `self', but
your problems are probably stemming from this issue.
No: the problem is that channelArray is initialized once in init, and
another time in changeChannelLevel: , where it is not retained.
While not harmful, and probably good style (except for the the
'if(!self) return nil' line), the "standard init pattern" is also most
of the time not that useful when compared to the simple '[super init]'.
Marco Scheurer
Sen:te, Lausanne, Switzerland
_______________________________________________
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