Target_Action 设计模式

来源:互联网 发布:oracle sql高级编程 编辑:程序博客网 时间:2024/05/16 17:04

@property (nonatomic, assign)id target;

@property (nonatomic, assign)SEL action;


- (void)viewDidLoad

{

    Button * button =[ [ButtonView  alloc] initWithFrame:CGRectMark(20, 120, 280, 140) ];

    [self.view addSubView: button];

    [button release];

}


button.target = self;

button.action = @select (buttonClicked);

0 0