Is there a way to print SEL action?

ios, objective-c, selector

Solution

You want

NSLog(@"%s: sender=%@, selector=%s", __FUNCTION__, sender,sel_getName(action));

Problem

For example, I want to trace the actions sent to my canPeformAction and they are too numerous to display at each occurrence with a "hover" in the debugger. Therefore, I want to trace to the log and examine it after my test cycle. ``` - (BOOL)canPerformAction:(SEL)action withSender:(id)sender { NSLog(@"%s: sender=%@", __FUNCTION__, sender, action); } ```

Original source