Cocoa forControlEvents:WHATGOESHERE

后端 未结 2 532
时光取名叫无心
时光取名叫无心 2021-01-07 04:42

In Cocoa/Objective-C if I have created a button programmatically, what do I put in for my control event?

[btnMakeChar addTarget:self action:@selector(makeCha         


        
2条回答
  •  北荒
    北荒 (楼主)
    2021-01-07 05:26

    The method you're asking about does not exist in Cocoa, so nothing goes there. Cocoa controls have a single target with a single action, and either use a different addTarget:-type method for each kind of action or expect a delegate object that will handle all the events they generate.

提交回复
热议问题