为什么不改变uilabel?
我创建了一些类,但不能覆盖setter
.h文件的代码
@interface ViewController : UIViewController
{
UILabel * _lblName;
}
@property (retain, nonatomic) IBOutlet UILabel * lblName;
@end
.m文件的代码
@synthesize lblName = _lblName;
- (void)setLblName:(UILabel *)lblName{
if(![_lblName isEqual:lblName]){
[_lblName release];
_lblName = [lblName retain];}}
- (IBAction)didCustomBtnClick:(id)sender {
UILabel* lbl = [[UILabel alloc] initWithFrame:CGRectMake(0.0, 0.0, 100.0, 30.0)];
lbl.text = @"Duck";
self.lblName = lbl;
[lbl release];}