Couldn't Cast Value of Type UIButton: Swift -


i getting error of cannot cast value of type uibutton in console. thing not uibutton, labelenter image description here

enter image description here

would 1 know why?

looks viewwithtag(2) not label. check if adding button programmatically inside cell , setting tag value 2.

also try avoid forced unwrapped if possible prevent crash

guard let questionlabel = cell.viewwithtag(2) as? uilabel else {return} questionlabel.text = "yourvalue 

Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -