I am finding that when I initialize a new child class, I'm getting an object of the parent class returned.
Parent:
- (id)init
{
self = [[UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil] instantiateViewControllerWithIdentifier:@"EditController"];
return self;
}
Child:
- (id)init
{
NSLog(@"New child");
self = [super init];
return self;
}
If I alloc and init a child, it displays New child
but gives me back an object of the parent's class. Calling methods declared only in the child cause a crash.
Could someone explain how the initialization process is working here, and how I can create a child object?