【发布时间】:2011-05-01 13:38:20
【问题描述】:
我对 xcode4 有一点问题。 我的项目使用这种类型的代码时遇到问题:
- (id)init {
if (self = [super init]) {
}
return self;
}
我知道我可以通过以下方式解决它:
- (id)init {
if ((self = [super init])) {
}
return self;
}
或
- (id)init {
self = [self init];
if (self) {
}
return self;
}
但问题是,我在一个特殊项目中使用了大量外部库,我不想编辑这些文件,也不想将更新推送到 github 或其他东西。
那么有没有一个选项可以在 xcode 中停用这种类型的通知/问题发布?
【问题讨论】:
-
警告说什么?我没有收到此代码的警告。我认为 if 子句中的赋值是代码异味。
-
上面写着
Using the result of an assignment as a condition without parentheses。是的,我也不喜欢这种风格。但是第三方库确实使用了这个。
标签: objective-c xcode xcode4 issue-tracking