I have a custom UIView class. Inside it I have declared an IBOutlet property for UIImageView.
#import
I just had the exact same problem and the solution is really easy:
You're accessing myImage to soon - that's it.
Withing -(id) initWithCoder:(NSCoder *)aDecoder{ and - (id)initWithFrame:(CGRect)frame the UIView is not already drawed. So myImage is not initalized yet.
You can test it if you add a UIButton and an IBAction and do something like this:
- (IBAction)buttonClicked:(id)sender {
NSLog(@"%@",myImage);
}
And you'll see how myImage is not nil anymore.