Argument type 'NSObject -> () -> xxx你的類(lèi)名' does not conform to expected type 'AnyObject'
原因是在成員變量里面addTarget self
分析: 先執(zhí)行成員變量創(chuàng)建,才得到完整的self,寫(xiě)到里面self還不完整,編譯器不能認(rèn)識(shí)他是AnyObject
解決方法是寫(xiě)到外面不要寫(xiě)到 成員變量里面
Argument type 'NSObject -> () -> xxx你的類(lèi)名' does not conform to expected type 'AnyObject'
原因是在成員變量里面addTarget self
分析: 先執(zhí)行成員變量創(chuàng)建,才得到完整的self,寫(xiě)到里面self還不完整,編譯器不能認(rèn)識(shí)他是AnyObject
解決方法是寫(xiě)到外面不要寫(xiě)到 成員變量里面