I have a number of View Controllers that share properties/behavior, so naturally I made them inherit from a common base controller. One thing they all have in common is a footer object (UIImageView), though with a different image. The UIImageView is defined in the base class.
When I add the image view to the controllers in the storyboard and wire them up to the object defined in the base class, it seems to work fine but the image doesn't display unless I write code and manually add the image to the view of the view controller.
If I define UIImageView on each of the concrete classes instead of the base class, everything works fine. So to give a more clear example, say I have:
BaseViewController
- (IBOutlet) UIImageView;
ChildViewController1 : BaseViewController
ChildViewController2 : BaseViewController
I can add the image to child 1 and 2 in the storyboard and assign it to the image view defined in the base but the image won't show unless I manually code it. But if I do this:
BaseViewController...
ChildViewController1 : BaseViewController
- (IBOutlet) UIImageView;
ChildViewController2 : BaseViewController
- (IBOutlet) UIImageView;
If I wire this up in the storyboard the images show without any code written. Also, if I simply add an image to the view controllers without any wiring up, they show fine.
Any ideas?
initWithNibName:bundle:is not called for storyboards. Instead,initWithCoder:is called.nil.