NSTimer Xcode 警告
我有一个 NSTimer,我用 scheduledTimerWithTimeInterval:
初始化,时间间隔很短(0.1 秒),没有重复,然后再也不会使用它,因为它会自行失效,因此释放其对目标的保留。 Xcode 警告它是一个未使用的变量,我很好奇是否有一种明智的方法可以消除该警告(黄色让我眼花缭乱!)
谢谢。
I have an NSTimer
that I initialize with scheduledTimerWithTimeInterval:
with a very short interval (.1 seconds) with no repeat, and then never use it again as it invalidates itself and therefore releases its retain on the target. Xcode warns that it is an unused variable, and I was curious if there was a sensible way to get rid of the warning (The yellow upsets my eyeballs!)
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您不再使用它,请不要将其保存在变量中。
会工作得很好
if you don't use it again don't save it in a variable.
will work perfectly fine
如果您不打算使用返回值,请不要将结果分配给任何内容。
Just don't assign the result to anything if you aren't going to use the return value.