mobibob mobibob -4 years ago 126
iOS Question

Is there a way to print SEL action?

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);

Answer Source

You want

NSLog(@"%s: sender=%@, selector=%s", __FUNCTION__, sender,sel_getName(action));
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download