Swift3 - Result of call '***' is unused
来源:互联网 发布:手机防吸费软件 编辑:程序博客网 时间:2024/05/20 06:57
参考译文:http://stackoverflow.com/questions/39692602/result-of-call-is-unused
在早期的Swift版本中,我们不必担心方法的返回值。可以存储在任何变量和使用它或者你可以完全忽略它。它既没有给任何错误也没有警告。
分两种情况:
1.如果您想使用返回的值,您可以创建一个变量/常数,并将其存储在它的值,即
let value = taskForDELETEMethod {
// Your code goes here
}
例子:
let value= view.tap(self, action: #selector(CCContentActionAlertView.dismiss))
2.如果你想忽略返回值,你可以使用_,即
let _= ** {
// Your code goes here
}
例子:
let _ = view.tap(self, action: #selector(CCContentActionAlertView.dismiss))
1 0
- Swift3 - Result of call '***' is unused
- Swift3.0 Result of call to 'XXX' is unused
- Swift Result of call to ‘XXX’ is unused
- Swift 3.0 出现 Result of all to 'XX' is unused 警告 解决
- "Expression of type "UIViewController?" is unused".
- The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one
- integer operation result is out of range
- call of overloaded 'round(&float)' is ambiguous
- Xcode 8, Swift 3: “Expression of type UIViewController? is unused” warning
- Xcode 8 / Swift 3: “Expression of type UIViewController? is unused” warning
- Warning[Pe061]: integer operation result is out of range
- warning: #61-D: integer operation result is out of range
- call of overloaded 'max(char&, char&)' is ambiguous
- call of overloaded `pow(int, int)' is ambiguous;
- C++: 解释error: call of overloaded ‘abs(int)’ is ambiguous
- Bug-List: call of overloaded 'sqrt(u16&)' is ambiguous
- Linux内核warn_unused_result [-Werror=unused-result]报错问题
- [Objective-C] NSArray initWithObjects "Expression result unused" warning
- (DT系列六)devicetree中数据和 struct device有什么关系
- 软件工程学习总结(1)——软件测试工具详解
- c语言sizeof()在32位及64位系统的区别
- Webpack入门——使用Webpack打包Angular项目的一个例子
- Java多线程之Lock的使用
- Swift3 - Result of call '***' is unused
- ceph异步消息类图
- Mysql处理海量数据时的一些优化查询速度方法
- 一个三流学校程序员的奋斗
- 获取当前系统语言环境
- Mysql 备份恢复备份和恢复类型
- RxJava 和 RxAndroid 四(RxBinding的使用)
- 洛谷 P2633 王后万岁
- php5对象复制、clone、浅复制与深复制