0

I have following setting in my app. A navigation controller, two view controllers with tableview each. In the second tableview there is a static cell with a switch. When I tap on a cell in the first tableview the second controller gets called. Here is my problem. When I call the first time the second vc, everything is fine, i go back, call a second time, fine. I go back, call a third time i get an exception. I found out it was the UISwitch to blame. I found also out it happens only when the switch get set to a different state. But now I found out that it has to do with the -thumbTintColor property. If i dont set this property everthing works fine. Somebody experenced the same issue?

Sven
  • 33
  • 1
  • 2
  • mySwitch.thumbTintColor = someColor; – Sven Oct 04 '12 at 18:24
  • Since it happens everywhere in my code its pretty pointless to post it. It does not crash when I dont set this property, so I dont know what you are looking for.. and no, mySwitch is not nil, its always an UISwitch instance. – Sven Oct 04 '12 at 18:31
  • Its even happening when I use [[UISwitch appearance] setThumbTintColor:someColor]; – Sven Oct 04 '12 at 18:33
  • I think the problem is a side effect of some class variable that you are reusing and not with setThumbTintColor. It can be the switch, the vc or other. – flopes Oct 04 '12 at 19:16
  • http://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&ved=0CDEQFjAA&url=http%3A%2F%2Fstackoverflow.com%2Fquestions%2F12972500%2Fuiswitch-setthumbtintcolor-causing-crash-ios-6-only&ei=RsO9UKuyOYKzrAeVoYD4CA&usg=AFQjCNFTAcHk_ByjiUPr_ix6XY_OF1Jchg&sig2=_MIw5ApGAagLm6Vfz2NCLA helps? – Bourne Dec 04 '12 at 09:34

1 Answers1

0

Here is an other post with the same problem and a workaround to solve the problem. UISwitch setThumbTintColor causing crash (iOS 6 only)?

Community
  • 1
  • 1
Carmen
  • 6,177
  • 1
  • 35
  • 40