Questions tagged «retain-cycle»

10
如何使用参数正确处理Swift块中的弱自我
在我的中TextViewTableViewCell,我有一个变量来跟踪一个块,还有一个配置方法,在该方法中传递和分配了该块。 这是我的TextViewTableViewCell课: // // TextViewTableViewCell.swift // import UIKit class TextViewTableViewCell: UITableViewCell, UITextViewDelegate { @IBOutlet var textView : UITextView var onTextViewEditClosure : ((text : String) -> Void)? func configure(#text: String?, onTextEdit : ((text : String) -> Void)) { onTextViewEditClosure = onTextEdit textView.delegate = self textView.text = text } // #pragma mark …
151 ios  swift  retain-cycle 
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.