When I complie my project with Xcode 7 i have new compiler errors
Method override for the designated initializer of the superclass '-init' not found
suggest that NSObject init is marked as designeted initializer.
My class look like this:
- (nullable instancetype)initWithModel:(nonnull Model *)model
view:(nonnull UIView *)view NS_DESIGNATED_INITIALIZER;
This object is initialize with view and model that is used to controll it. It's shoudn't exist without any of it, that why it has nonull.
The view is created from storyboard, model comes from CoreData.
My question is, how should I handle the requried init?
Something like this make my code to complie but I doesn't have any sense.
- (instancetype)init {
Model *model = [Model new];
View *view = [View new];
self = [self initWithModel:model view:view];
return self;
}