나는 초기화 방법을 가지고있다. & & 또는 ||를 사용하는 경우 모든 멤버가 초기화되기 전에 클로저로 '자체'를 캡처하는 이유는 무엇입니까? 피연산자.&&, ||를 사용하여 클로저 오류로 '자체'를 캡처했습니다. operator
var type:Type? = .non
init(dictionary:[String:AnyObject]){
if let type = dictionary["type"] as? Int {
self.type = Type.init(rawValue: type)!
}
//'self' captured by a closure before all members were initialized
if self.type == .picture || self.type == .textWithPicture {
//........
}
}
전체 클래스 선언을 제공 할 수 있습니까? 그냥 메서드를 생략하십시오. – mownier
if 문을 전달할 수 없기 때문에 – CZ54