Deadly init methods -- Xcode won't build

I tried to add the below code from the book, however, the compiler complaint “Control reaches end of non-void function”. This is not working as expected.

-(instancetype)init { [NSException raise:@"BNRWallSafeInitialization" format:@"Use initWithSecretCode:, not init"]; }

expected:
The code should be built successfully unless I call this init method in main.m, the program crashes and shows the expected error messages.

To calm the compiler, just add the missing return statement.

-(instancetype)init
{
    [NSException raise:@"BNRWallSafeInitialization" format:@"Use initWithSecretCode:, not init"];
    return self; // or return nil;
}