How do I create a basic UIButton programmatically?

后端 未结 30 917
清歌不尽
清歌不尽 2020-11-22 14:41

How can I create a basic UIButton programmatically? For example in my view controller, when executing the viewDidLoad method, three UIButton<

30条回答
  •  失恋的感觉
    2020-11-22 15:22

    'action:@selector(aMethod:)' write method like this :

    - (void)aMethod:(UIButton*)button
       {
             NSLog(@"Button  clicked.");
      }
    

    It works for me. Thanks. KS.

提交回复
热议问题