Re: New error “Method override for the designated initializer of the superclass ‘-init’ not found”
Re: New error “Method override for the designated initializer of the superclass ‘-init’ not found”
- Subject: Re: New error “Method override for the designated initializer of the superclass ‘-init’ not found”
- From: Sean McBride <email@hidden>
- Date: Tue, 09 Jun 2015 18:23:15 -0400
- Organization: Rogue Research Inc.
On Tue, 9 Jun 2015 13:40:27 -0700, Jens Alfke said:
>- (instancetype) init {
> @throw [NSException exceptionWithName: NSInternalInconsistencyException
> reason: @"Flump cannot be initialized
>with -init"
> userInfo: nil];
>}
>
>But this didn’t fix it. The new -init method gets an error “Convenience
>initializer missing a ‘self’ call to another initializer”. The only way
>to get rid of this error is to add a call to -initWithString … but
>there’s no valid parameter I can pass because the caller didn’t provide
>a string. Nor can I put this -init call after the throw, because then
>the compiler complains that it’s unreachable.
>
>It seems as though whoever designed this hadn’t thought through the case
>where a subclass wants to _get rid of_ a superclass’s designated
>initializer, i.e. make it illegal to call it.
I can only say that I see a few dozen of these warnings in my codebase too, after playing with Xcode 7 today. I concur with your analysis. I also tried:
- (instancetype)init
{
assert(0);
}
Thinking maybe it would clue in on an old school assert, but no.
I guess we have to file Radars and pray. :)
Cheers,
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden