Advertise Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

sdkIQ for iPhone
($4.99)

Your First iPhone App
($1.99)

iPhone Code Generator
($9.99)

Dual Matches
($0.99)

Calcuccino Programmers' Calculator
($2.99)

SDKtoday
(free)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 03-08-2009, 12:10 AM   #1 (permalink)
New Member
 
Join Date: Mar 2009
Posts: 16
Default 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 12:47 AM. Reason: added code
Savij is offline   Reply With Quote
Old 03-08-2009, 05:34 AM   #2 (permalink)
Registered Member
 
Join Date: Jan 2009
Location: Florida
Age: 22
Posts: 31
Default

f.

Last edited by ArgMan; 07-09-2009 at 08:12 PM.
ArgMan is offline   Reply With Quote
Old 03-08-2009, 06:21 PM   #3 (permalink)
New Member
 
Join Date: Mar 2009
Posts: 16
Default

Quote:
Originally Posted by ArgMan View Post
I don't know enough to give you an answer, but may I just say: +1 for the thread title. Very nice.
<grin> thanks.

Can anyone point me in the right direction??

Thanks,

-Savij
Savij is offline   Reply With Quote
Old 03-08-2009, 10:13 PM   #4 (permalink)
New Member
 
Join Date: Sep 2008
Posts: 1,431
Default

What is the exception that appears in the console?

Use the code tags for showing code.

Put the IBOutlet token on your property, not (only) on your ivar.

Last edited by PhoneyDeveloper; 04-02-2009 at 10:05 PM.
PhoneyDeveloper is offline   Reply With Quote
Old 03-08-2009, 10:30 PM   #5 (permalink)
New Member
 
xlphs's Avatar
 
Join Date: Dec 2008
Location: Miami, FL
Posts: 36
Default

In IB, check class identity, make sure you have the correct view controller.
xlphs is offline   Reply With Quote
Old 03-09-2009, 08:26 PM   #6 (permalink)
New Member
 
Join Date: Mar 2009
Posts: 16
Default

Quote:
Originally Posted by xlphs View Post
In IB, check class identity, make sure you have the correct view controller.
Thanks for the tips, I know the class identity is correct, but I did forget the IBOutlet on the property. I'll give that a try.

Thanks!!
-S
Savij is offline   Reply With Quote
Old 04-02-2009, 08:46 PM   #7 (permalink)
New Member
 
Join Date: Mar 2009
Posts: 16
Default

Just realized I never closed out this thread. The problem I had, I could not figure out. I copied the code to a new project and it worked! I must have changed some setting in xcode inadvertantly, or maybe the project got corrupt somehow.

Anyway the above worked great! Thanks for the help

-J
Savij is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


» Advertisements
» Stats
Members: 41,862
Threads: 49,771
Posts: 213,058
Top Poster: BrianSlick (3,139)
Welcome to our newest member, futurevilla216
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 07:06 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0