gpt4 book ai didi

objective-c - Objective-C : "Property implementation must have its declaration in interface"

转载 作者:太空狗 更新时间:2023-10-30 03:35:42 25 4
gpt4 key购买 nike

我有以下代码:

//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

...

我正在使用 XCode 4.1,想知道是否有人可以帮助我弄清这个错误的根源。我是 XCode 的新手。

非常感谢,

最佳答案

您需要在您的接口(interface)中使用@property 声明该属性。

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

这里使用了非原子,因为它是一个 IBOutlet。另请注意,该属性具有保留修饰符,这意味着您有责任在不再需要该对象时释放该对象。

关于objective-c - Objective-C : "Property implementation must have its declaration in interface",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7420100/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com