直接访问实例变量

Eri*_*ite 5 objective-c clang

我从github下载了XCDFormInputAccessoryView https://github.com/0xced/XCDFormInputAccessoryView。我尝试在 xcode 中运行它并收到许多警告

实例变量“---”正在被直接访问。有什么帮助吗?

- (void) setTextInputs:(NSArray *)textInputs
{
    // Some day, IBOutletCollection will be properly sorted, in the meantime, sort it!
    _textInputs = [textInputs sortedArrayUsingComparator:^NSComparisonResult(UIView *view1, UIView *view2) {
        return [@(view1.tag) compare:@(view2.tag)];
    }];
}
Run Code Online (Sandbox Code Playgroud)

Cod*_*aFi 3

这是 Cedric 打开标志的结果-Weverything,这使得 LLVM 生成迂腐的警告。删除构建设置下的标志:

不再有 -Weeverthing

然后重新编译,错误就会消失。