Now that I know that NSEvent does not exist on ios - what do I need to do to capture an event like touchUpInside and cause it to call my method to handle it, WITHOUT Interface Builder?
I think this like asking how do I link an event to an outlet without IB...
I know it can be done, but I can't find anything that shows how - except Mac-only examples that use NSEvent.
Take a look at this method in UIControl:
- (void)addTarget:(id)target action:(SEL)action forControlEvents:(UIControlEvents)controlEvents
Each of the different event types has a constant, such as UIControlEventTouchUpInside. Here's an example of it being used:
[addButton addTarget:self action:@selector(increment:) forControlEvents:UIControlEventTouchDown];
Look here for the values of controlEvents, listed in the Constants section.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论