objective c - Thread 1: EXC_BAD_INSTRUCTION (code=EXC_1386_INVOP, SUBCODE=0x0) -


when run app, error in these lines:

ballonview = (cell!.contentview.viewwithtag(0)!.viewwithtag(1) as? uiimageview)! label = (cell!.contentview.viewwithtag(0)!.viewwithtag(2) as! uilabel) 

here original code in objective-c, want in swift

balloonview = (uiimageview *)[[cell.contentview viewwithtag:0] viewwithtag:1]; label = (uilabel *)[[cell.contentview viewwithtag:0] viewwithtag:2]; 

so, can do?

if of associated storyboard elements youll need make sure connected , identified. in experience thats first place need check when there crash involving ui elements.

also, extremely beneficial unwrap optionals in safe manner well. 3 bangs in same line giant red flag.


Comments

Popular posts from this blog

ios - Memory not freeing up after popping viewcontroller using ARC -

Django REST Framework perform_create: You cannot call `.save()` after accessing `serializer.data` -

Why does Go error when trying to marshal this JSON? -