Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NSLog warning #15

Closed
sos1a2a3a opened this issue Apr 18, 2018 · 3 comments
Closed

NSLog warning #15

sos1a2a3a opened this issue Apr 18, 2018 · 3 comments

Comments

@sos1a2a3a
Copy link

sos1a2a3a commented Apr 18, 2018

警告:Expression result unused

方法 objcLog 也没有 返回值啊

求解

谢谢

具体的 是这样 :

想打印 一个 int 或者 float 或者 NSInteger 数值

NSLog(@"num:%ld",index);
报错:Implicit conversion of 'int' to 'id _Nonnull' is disallowed with ARC

然后我转成 NSNumber

NSLog(@"num:%@",[NSNumber numberWithInt:index]);

就出现 警告:Expression result unused

@sos1a2a3a
Copy link
Author

sos1a2a3a commented Apr 18, 2018

object-c 项目

@CocoaDebug
Copy link
Owner

没太明白你的意思,你用cocoapods还是carthage导入的?有完整代码或截图吗?谢谢!

@CocoaDebug CocoaDebug added the help wanted Extra attention is needed label Apr 18, 2018
@sos1a2a3a
Copy link
Author

解决了 少写一句话
#pragma clang diagnostic ignored "-Wunused-value"

@CocoaDebug CocoaDebug removed the help wanted Extra attention is needed label Apr 2, 2019
@CocoaDebug CocoaDebug changed the title 给demo 里面 的 NSLog换了个 名字 然后 使用NSLog 出现 警告 NSLog warning Jun 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants