如何在 XCode 中屏蔽不需要的“Dead Store”警告?那就是我有这段代码,我认为这不是问题,所以如果是这种情况,我不想继续看到警告......(欢迎提供反馈)
代码在这里:
// 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
警告详细信息 = 存储在“currVertPos”的值永远不会被读取。
所以最后一行确实不需要“currVertPos”,但这真的很重要吗?如果不是,我该如何消除警告?
最佳答案
不,警告无关紧要;您可以简单地通过不做商店来消除它。删除最后一行的 currVertPos =
就不会出现任何警告。
关于iphone - 如何在 XCode 中屏蔽不需要的 "Dead Store"警告?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5294761/