swift-错误unrecognized selector sent to instance
发布时间:2020-12-14 01:56:08 所属栏目:百科 来源:网络整理
导读:错误提示 *** Terminating app due to uncaught exception 'NSInvalidArgumentException',reason: '-[DBFM.ViewController onPlay]: unrecognized selector sent to instance 0x7fe3586a3820' 相关代码 btnPlay . addTarget ( self ,action: "onPlay" ,forCo
错误提示
*** Terminating app due to uncaught exception 'NSInvalidArgumentException',reason: '-[DBFM.ViewController onPlay]: unrecognized selector sent to instance 0x7fe3586a3820'
相关代码
btnPlay.addTarget(self,action: "onPlay",forControlEvents: UIControlEvents.TouchUpInside)
解决方法 (带参数的方法应该加上冒号: )
btnPlay.addTarget(self,action: "onPlay:",forControlEvents: UIControlEvents.TouchUpInside)
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |