Goal C: "The property implementation must have its declaration in the interface"

I have the following code:

//RootViewController.h:

#import <UIKit/UIKit.h> @interface RootViewController : UIViewController{ IBOutlet UITextField *login_uname; IBOutlet UITextField *login_pword; IBOutlet UIActivityIndicatorView *login_thinger; IBOutlet UIImageView *logo; IBOutlet UISwitch *login_remember; IBOutlet UIScrollView *scrollView; } -(IBAction) login_submitClick:(id)sender; -(IBAction) doneEditing:(id)sender; -(IBAction) clearPword:(id)sender; -(void) showSignUp:(id)sender; -(void)doLogout:(id)sender; //for file handling: -(NSString *)documentsPath; -(NSString *)readFromFile:(NSString *)filePath; -(void) writeToFile:(NSString *)text withFileName:(NSString *) filePath; @end 

//RootViewController.m

 #import "RootViewController.h" //#import "Main.h" //#import "SignUp.h" #import "ASIHTTPRequest.h" #import "ASIFormDataRequest.h" #import "CommonCrypto/CommonHMAC.h" #import "Details.h" //#import "signUpSMS.h" #import "JSON.h" @implementation PrestoCab3ViewController @synthesize login_uname; //this line throws the error in the title ... 

I am using Xcode 4.1 and was wondering if anyone could help me figure this out. I am very new to Xcode.

Thank you very much in advance,

+7
source share
1 answer

You need to declare a property with @property in your interface.

 @property( nonatomic, retain ) IBOutlet UITextField * login_uname; 

Here non-atomic is used because it is an IBOutlet. Also note that the property has a save modifier, that is, you are responsible for releasing the object when you no longer need it.

+13
source

All Articles