I have about 15 UIButtons in my controller. I am trying to clear 10 of them with a simple loop and it looks like I am getting some kind of conflict.
When I press the button to clear, I get the following error:
Failed to pass value of type '_UISizeTrackingView' (0x18a023c) to 'UIButton' (0x1899298). (lldb)
For the loop:
for var i = 0; i < 9; i++ { button = view.viewWithTag(i) as! UIButton button.setImage(nil, forState: .Normal) }
I narrowed it down to a problem with an element using the 0 tag. I looked through all the elements in my View Controller panel and see no conflicts. I see only one button using tag = 0.
I even compiled it, replacing the βiβ in the loop with β0β and getting the same problem. When I replaced it with β1β or β2β, it works fine with this single image.
How to find out which object uses tag 0? I clicked on all of them (including the main "View"), but it seems that I did not find anything.
source share