Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

selector/method name as string argument

So this code works (sends the method name as a string to the receiving method)

[self.Client sendDigitalJoinAndReleaseByName:[NSString stringWithFormat:@"%s",_cmd]];

However since ios 6 (I think) I now get a warning

Format specifies type 'char *' but the argument has type SEL

Is there even a format specifier for SEL? What is the proper way to do this (so that there is no warning)?

like image 487
owen gerig Avatar asked Mar 28 '26 13:03

owen gerig


1 Answers

Just use NSStringFromSelector(_cmd) and print the result.

like image 95
Jon Shier Avatar answered Apr 01 '26 08:04

Jon Shier