@property
@sythesize
当.h文件变量命名以_开头,一起使用相当于@property
用@sythesize时,可以重写getter或setter方法,以满足具体需要
方法重写:
1、重写系统的方法:如init、dealloc等
2、重写自己的方法:如子类需要在父类的一些方法上增加某些东西
回顾:UILabel UIImageView UITextField UIView UIButton Timer
未掌握:UIButton Timer UILabel
已掌握:@property @sythesize等
未掌握总结:
UILabel *lb = [[UILabel alloc]initWithFrame:CGRectMake(100,100,100,100)];
lb.text = @"god bless you";
lb.textColor = [UIColor redColor];
lb.font = [UIFont fontOfSize:26];
lb.shadowColor = [UIColor purpleColor];
lb.shadowSize = CGSizeMake(2,2);//写错了。。。。。。应是shadowOffSet
lb.numberOfLines = 0;//忘记
lb.textAligment = NSTextAligment;//忘记,以前错过多次
[self.window addSubview];
UIButton *btn = [UIButton buttonWithType:UI];//buttonWithType后面......
btn.frame = CGRectMake(100,100,100,100);
btn.backgroundColor = [UIColor grayColor];//这句忘记了(默认透明颜色,大部分需要写)
[btn setTitle:@"click" forState:UIControlStateNormal];
[btn setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
[btn addTarget:self action:@selector(method) forControlEvents:UIControlEventTouchUpInside];//记不清......
[self.window addSubview:btn];
[NSTimer scheduledTimerWithTimeInterval:0.1 target:self selector:@selector(gotoo) userInfo:nil repeats:YES];//压根没记住......