A noob and his nib, hooking a UIImageView
hello,
I am learning iPhone dev and I love it so far. I am having an issue where I created a UITabBarController that loads 4 views. All of this was done in the nibs (except for actually creating the UITabBarController in the delegate class). Everything works perfectly. What I want to do is hook an UIImageView in the xib so I can change it in code from the viewcontroller. So I created an IBOutlet in my firstViewController and dragged a UIImageView onto my view. But anytime I hook the outlet up, the application just bombs. I even tried dragging a UIImageView into the firstView.xib and didnt put it on the view, that runs fine, but when I hook up the outlet it just bombs on me with an uncaught exception.
Maybe I am approaching this the wrong way. Ultimately I want a view with a few images that the user can swipe to view. Am I going about this the wrong way?
Thanks and sorry if this is really basic stuff... I am a c# developer but I'm tryin real hard to convert.
Here is my code:
@interface HomeViewController : UIViewController {
IBOutlet UIImageView *homeImageView;
}
@property(nonatomic,retain) UIImageView *homeImageView;
@end
@implementation HomeViewController
@synthesize homeImageView;
Then I just ctrl+drag from File Owner to the ImageView in IB and save. Then BOOM!
-Savij
Last edited by Savij; 03-08-2009 at 01:47 AM.
Reason: added code
|