Linking Interface Builder to XCode


/ Published in: Objective C
Save to your folder(s)

Important: After adding the Header File Code below, save then jump back to Interface Builder and Ctrl+Click on File's Owner and assign the Outlet to the correct component under View.


Copy this code and paste it in your HTML
  1. /* HEADER FILE */
  2. #import <UIKit/UIKit.h>
  3.  
  4. @interface ViewController : UIViewController {
  5. IBOutlet UIClassName *variableName;
  6. }
  7.  
  8. @property (nonatomic, retain) UIClassName *variableName;
  9.  
  10. @end
  11.  
  12.  
  13. /* IMPLEMENTATION FILE */
  14. #import "ViewController.h"
  15.  
  16. @implementation ViewController
  17.  
  18. @synthesize variableName;
  19.  
  20. - (void)dealloc {
  21. [variableName release];
  22. [super dealloc];
  23. }
  24.  
  25. @end

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.