ideashower / ShareKit

Drop in sharing features for all iPhone and iPad apps
http://getsharekit.com
1.79k stars 376 forks source link

Editing of exclusions list doesn't work in iOS 4.2 #120

Open dginsburg opened 13 years ago

dginsburg commented 13 years ago

Something weird going on with the 4.2 GM. Reading the "on" property of a UISwitch isn't returning what it was just set to. Maybe it has to go through a run loop because of the animation flag. Likely a bug but it is the current behavior of 4.2. The function below in SHKShareMenu.m fixes the problem for all iOS versions.

Sorry I don't know Git well enough to submit this the proper way.

ideashower commented 13 years ago

Just verified this, thanks for the update.

mehtaVikram commented 13 years ago

I just hit the same bug, I fixed in a diff way. I think the problem is [toggle setOn:nowOn animated:YES]; I think before the animation is complete the next line of code executes and samples old value of toggle.on.

I changed the line to [toggle setOn:nowOn animated:NO]; issue is gone.

tgaul commented 13 years ago

There's another way to fix the problem without disabling the animation, which is nice to have. Assign a local variable and use that rather than reading the new "on" value. For example: BOOL newOn = !toggle.on; [toggle setOn:newOn animated:YES]; if(newOn) ...

sk-9 commented 12 years ago

thanks a lot, very helpful.