嘿,我今天刚开始ios编程,我正面临着这个错误.
PLZ帮我删除此错误
PLZ建议我一些不错的ios开发人员教程
#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@property (weak, nonatomic) IBOutlet UITextField *txtUsername;
@property (weak, nonatomic) IBOutlet UITextField *txtPassword;
- (IBAction)loginClicked:(id)sender;
- (IBAction)backgroundClick:(id)sender;
@end
Run Code Online (Sandbox Code Playgroud)
Rob*_*Rob 20
如果您不使用ARC,则无法使用weak
.对于IBOutlet
非ARC代码引用,更换你的引用weak
与retain
,来代替.(这有点令人困惑,但通常你使用assign
而不weak
是非ARC代码,但对于IBOutlet
引用,你使用retain
.)
更好的是,正如nneonneo所说,你应该使用ARC.
归档时间: |
|
查看次数: |
29506 次 |
最近记录: |