Hi all,
I am just trying to understand what Hillegass means here.
He is talking about designated initializers, and how one should use it if a class has more than one initializer. And how a DI will call it's super's DI if there is one. So far so good.
But then he says
And the code to illustrate this is
It probably makes a lot more sense to someone other than I, so would like a "clue" as to what it means.
I am just trying to understand what Hillegass means here.
He is talking about designated initializers, and how one should use it if a class has more than one initializer. And how a DI will call it's super's DI if there is one. So far so good.
But then he says
The day will come when you will create a class that must, must ,must have an argument supplied. Override the superclass's designated initializer to throw and exception
And the code to illustrate this is
Code:
-(id) init
{
[self dealloc];
@throw [NSException exceptionWithName:@"BNRBadInitCall" reason: yada yada ", userInfo: nil];
return nil;
}
It probably makes a lot more sense to someone other than I, so would like a "clue" as to what it means.