如何掩盖不需要的“死店” XCode中的警告? [英] how to mask an unwanted "Dead Store" warning in XCode?

查看:83
本文介绍了如何掩盖不需要的“死店” XCode中的警告?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在XCode中屏蔽不需要的死店警告?这就是我有这个代码,我不认为这是一个问题,所以如果是这种情况我不想继续看到警告......(欢迎提供反馈)

How to mask an unwanted "Dead Store" warning in XCode? That is I have this code for which I don't think it's an issue, so if this is the case I don't want to keep seeing the warning...(welcome for feedback however)

代码在这里:

// Position and Size Labels in Cell
CGFloat currVertPos = 0; // Maintain lowest position, i.e. starting vertical point for next cell

// Set Position & Get back next veritical position to use
currVertPos = [self resizeLabel:_mainLabel atVertPos:currVertPos];
    currVertPos = [self resizeLabel:_mainLabel2 atVertPos:currVertPos];
    currVertPos = [self resizeLabel:_mainLabel3 atVertPos:currVertPos];
currVertPos = [self resizeLabel:self.secondLabel atVertPos:currVertPos];  // WARNING OCCURS HERE 

警告细节=存储的值currVertPosat永远不会被读取。

Warning Detail = Value stored "currVertPos" at is never read.

所以对于最后一行来说,确实不需要currVertPos,但这真的很重要,如果不是,我怎么能使警告静音?

So it's true that for the last line the "currVertPos" isn't needed, but does it really matter, and if not how can I silence the warning?

推荐答案

不,警告无关紧要;你可以简单地通过不做商店来消除它。从最后一行删除 currVertPos = ,没有什么可以提醒你的。

No, the warning doesn't matter; you can eliminate it simply by not doing the store. Delete the currVertPos = from the last line and there will be nothing to warn you about.

这篇关于如何掩盖不需要的“死店” XCode中的警告?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆