Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

whitedragon101

macrumors 65816
Original poster
Sep 11, 2008
1,349
339
I have a UIButton which I have created in interface builder and I want to access it programatically. However writing the following code and ctrl+dragging in interface builder from the view controller to the button does not display a link to the IBOutlet . It only shows the word view.

Code:
#import <UIKit/UIKit.h>

@interface LoadScreenVC : UIViewController
{
    IBOutlet UIButton *myButton;
} 

@property (nonatomic, retain) IBOutlet UIButton *myButton;

@end
 
Have you correctly set the view controller to that class (not just UIViewController). Do you still need to re-import headers in the latest XCode?
 
Have you correctly set the view controller to that class (not just UIViewController). Do you still need to re-import headers in the latest XCode?

Thanks.:)

Didn't think about xcode itself but a clean and build plus restarting xcode seemed to work.

All done
 
And although probably not related to your problem, you don't need to IBOutlet your button twice. In fact, you can get rid of the instance variable, since you have a property for it.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.