您的位置:首页 > 移动开发 > Swift

swift 中使用weak self

2015-10-20 16:03 330 查看
request.responseString(encoding: NSUTF8StringEncoding) {[weak self] (res) -> Void in
if let strongSelf = self {
//do something...
}
}


weak var weakSelf = self
request.responseString(encoding: NSUTF8StringEncoding) {(res) -> Void in
if let strongSelf = weakSelf {
//do something
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: