PDA

View Full Version : IBOutlets not Showing Up With A Tab Bar App




phillipie99
Jul 12, 2010, 10:55 PM
I Created a Tab Bar App (from the template) and tried to add an IBOutlet to the viewControler.h/.m files but when I went to IB the outlets dont show up in the proxy object (Owner) or even in any object. They show up in the delegate if I declare them in the delegate.h/.m files. I,ve done everything correct for creating outlets and I know this is probably something simple. So what do I have to do to make the outlets show up in the owner object?



DonWilson
Jul 12, 2010, 11:16 PM
I Created a Tab Bar App (from the template) and tried to add an IBOutlet to the viewControler.h/.m files but when I went to IB the outlets dont show up in the proxy object (Owner) or even in any object. They show up in the delegate if I declare them in the delegate.h/.m files. I,ve done everything correct for creating outlets and I know this is probably something simple. So what do I have to do to make the outlets show up in the owner object?

Could you post some of your code? Did you remember to do the @property & @synthesize correctly?

phillipie99
Jul 12, 2010, 11:20 PM
Could you post some of your code? Did you remember to do the @property & @synthesize correctly?

I started with a blank tab Bar application, so there is litle code but here is how i declared them in the viewcontroller.h file

IBOutlet UITextFeild *test;

@property(nonatomic, retain) UITextFeild *test;

the .m file
@synthisize test;

[test dealloc];

Im not on my mac right now so I couldnt copy the code directly but that should be exactly or almost exactly how it is in xcode.

DonWilson
Jul 12, 2010, 11:39 PM
I started with a blank tab Bar application, so there is litle code but here is how i declared them in the viewcontroller.h file

IBOutlet UITextFeild *test;

@property(nonatomic, retain) UITextFeild *test;

the .m file
@synthisize test;

[test dealloc];

Im not on my mac right now so I couldnt copy the code directly but that should be exactly or almost exactly how it is in xcode.

UITextField not UITextFeild (probably just a typo in replying)

@property (...) IBOutlet UITextField *test;

phillipie99
Jul 12, 2010, 11:49 PM
UITextField not UITextFeild (probably just a typo in replying)

@property (...) IBOutlet UITextField *test;

Yup thats just a typo and trying it with the IBOutlet in the @property statement dosent make a difference. Still no outlets.

PhoneyDeveloper
Jul 13, 2010, 11:03 AM
There are some bugs in IB where it doesn't sync properly with Xcode. If you look at the lower left corner of the xib window there is a little LED icon. If the connection to the project is good then the icon is green. If it's bad then the icon is grey. Yellow also indicates a problem.

What color is your LED?

If grey then you may be able to fix it by checking for any spaces or other funny characters in the path to the project. Also, apparently opening the project or the xib file from the Finder may help. (I haven't seen this myself but there are lots of complaints on the Apple iPhone forum.) I do see the yellow LED.

phillipie99
Jul 13, 2010, 11:24 AM
There are some bugs in IB where it doesn't sync properly with Xcode. If you look at the lower left corner of the xib window there is a little LED icon. If the connection to the project is good then the icon is green. If it's bad then the icon is grey. Yellow also indicates a problem.

What color is your LED?

If grey then you may be able to fix it by checking for any spaces or other funny characters in the path to the project. Also, apparently opening the project or the xib file from the Finder may help. (I haven't seen this myself but there are lots of complaints on the Apple iPhone forum.) I do see the yellow LED.
Nope the LED is green. As i said it works if I put the connections in the delegate.h/.m files so it's working fine but not when I put the connections in the viewcontroler.h/.m maybe because it is a tabbar app with a tab bar controler not a normal view controler?

PhoneyDeveloper
Jul 13, 2010, 06:25 PM
Did you set the Class of the File's owner?

Do you want to show a screenshot of where you expect the outlets to be?

phillipie99
Jul 13, 2010, 06:34 PM
Did you set the Class of the File's owner?

Do you want to show a screenshot of where you expect the outlets to be?

Ill post a couple of screenshots up at about 8:30-9:00 (eastern standard time)

phillipie99
Jul 13, 2010, 08:43 PM
After trying with a few different types of software and the built in screen shot mecanism I was unable to take a screen shot. I here the photo sound but nothing apears on my desktop not matter what I try. Ill keep trying.

gittrac
Aug 9, 2010, 12:25 AM
screen shot can be achieved by SHIFT + COMMAND + 3 in Mac.

PhoneyDeveloper provided a very good point : What is the class of your File's owner. (It should be specified as your class definition not UIViewController)

Thanks! PhoneyDeveloper...