Open dginsburg opened 13 years ago
Just verified this, thanks for the update.
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.
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) ...
thanks a lot, very helpful.
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.
(void)tableView:(UITableView )tableView didSelectRowAtIndexPath:(NSIndexPath )indexPath { NSDictionary *rowData = [self rowDataAtIndexPath:indexPath];
if (tableView.editing) { UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
}
else { [NSClassFromString([rowData objectForKey:@"className"]) shareItem:item];
} }