Re: Problem chaining initialization methods
Re: Problem chaining initialization methods
- Subject: Re: Problem chaining initialization methods
- From: Rick Genter <email@hidden>
- Date: Sun, 3 Jan 2010 18:51:09 -0800
On Jan 3, 2010, at 6:36 PM, Mike Chambers wrote:
> -(id)initWithArray:(NSArray *)arr forKeyPath:(NSString *)keyPath
> {
> NSString *capPath = [keyPath capitalizedString];
> if(![self initWithArray:arr forKeyPath:keyPath andTitle: capPath]);
> {
> return nil;
> }
>
> return self;
> }
There is an extra semicolon at the end of the if() statement. You should be getting a warning about return self; not being reachable; the code is currently written as:
if (![self initWithArray:arr forKeyPath:keyPath andTitle:capPath])
;
{
return nil;
}
return self;
--
Rick Genter
email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden