iphone - 如何在 XCode 中屏蔽不需要的 "Dead Store"警告?

标签 iphone xcode ios xcode4

如何在 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/

相关文章:

ios - 如何为 ViewController segues 设置 if else 语句?

xcode - Xcode 中的 Vi 键

iphone - XCode 中没有配置文件的身份

iphone - iPad UI 在模拟器中被截断

iphone - 为什么我的属性 getter 会导致 NSZombie 错误?

ios - Xcode 名称问题

ios - 我如何在 View Controller 之间传递 UIImageView?

ios - 在后台模式下保持 XMPP 连接作为 BLE 附件(iOS、Swift)

iphone - 带有 iAd 框架的通用 iPhone/iPad 项目

iphone - 如何创建图像的 GridView ?单击图像时,它应该打开该图像