gpt4 book ai didi

objective-c - 选择器/方法名称作为字符串参数

转载 作者:塔克拉玛干 更新时间:2023-11-02 09:03:52 25 4
gpt4 key购买 nike

所以这段代码有效(将方法名称作为字符串发送到接收方法)

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

但是自从 ios 6(我认为)我现在收到警告

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

SEL 是否有格式说明符?执行此操作的正确方法是什么(以便没有警告)?

最佳答案

只需使用 NSStringFromSelector(_cmd) 并打印结果。

关于objective-c - 选择器/方法名称作为字符串参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13844219/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com