消除警告"property access result unused - getters should not be used for side effects"
2014-10-14 08:28
513 查看
我写了如下一段代码:
结果运行报警告"property access result unused - getters should not be used for side effects"
在StackOverflow上搜了一下,应该将
self.initShare;
改为
[self initShare];
来解决。
这也是因为我一直是Java开发过来的人,还不习惯Objc 方法的调用方式,造成的。
StackOverflow原帖地址 http://stackoverflow.com/questions/5346682/xcode-property-access-results-unused-getters-should-not-be-used-for-side-effe
- (void)btnClicked:(UIButton *)button { switch (button.tag) { case 1: self.initShare; break; default: NSLog(@"error!"); break; } } - (void)initShare { NSLog(@"分享一下。"); }
结果运行报警告"property access result unused - getters should not be used for side effects"
在StackOverflow上搜了一下,应该将
self.initShare;
改为
[self initShare];
来解决。
这也是因为我一直是Java开发过来的人,还不习惯Objc 方法的调用方式,造成的。
StackOverflow原帖地址 http://stackoverflow.com/questions/5346682/xcode-property-access-results-unused-getters-should-not-be-used-for-side-effe
相关文章推荐
- IOS警告:Property access result unused - getters should not be used for side effects
- iOS 整型转换警告"NSInteger' should not be used as format arguments; add an explicit cast to 'long' inste"
- - Templates should only be responsible for mapping the state to the UI. Avoid placing tags with side-effects in your templates, such as <script>, as they will not be parsed.
- iOS之整型转换警告Values of type 'NSInteger' should not be used as format arguments;
- Why 1904 testing methods should not be used for today’s students
- Why the "volatile" type class should not be used
- The server farm account should not be used for other services
- Why the "volatile" type class should not be used
- "==" and "!=" should not be used when "equals" is overridden
- values of type NSInteger should not be used as format arguments; 关于Xcode中烦人的32位与64位警告处理方法.
- SonarQube-Java规范之Atomic-".equals()" should not be used to test the values of "Atomic" classes
- Linux下开发warning:"the `gets' function is dangerous and should not be used"
- 转:Debugger problem "The breakpoint will not currently be hit. No symbols have been loaded for this document“
- MyEclipse中消除frame引起的“the file XXX can not be found."的提示
- Attribute "column" must be declared for element type "property"解决办法
- Repeated column in mapping for entity:should be mapped with insert="false" update="false"
- " org.hibernate.PropertyNotFoundException:Could not find a getter for ..
- VS2005智能设备项目的Bug:"The OutputPath property is not set for this project..."
- VS2005智能设备项目的Bug:"The OutputPath property is not set for this project..."
- Attribute "resultClass" must be declared for element type "insert".