facebookarchive / Tweaks

An easy way to fine-tune, and adjust parameters for iOS apps in development.
Other
4.74k stars 417 forks source link

FBTweak block action runs twice #55

Closed ghost closed 8 years ago

ghost commented 10 years ago

I wrote the default value with block but it runs twice

grp commented 10 years ago

Do you have a sample piece of code for how you're setting up the tweak? How are you running the action?

ghost commented 9 years ago
FBTweakAction(@"Map Search", @"Algorithm", @"Dijkstra:Distance", ^{
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Hello" message:@"This is a test for Tweak" delegate:nil cancelButtonTitle:nil otherButtonTitles:@"Done", nil];
    [alert show];
});
grp commented 9 years ago

How are you running the action? Looking at the code, I only see a single call to it when you tap a cell.

chenheng-wandoujia commented 9 years ago

I hava the same problem when run on simulator Xcode 6.1

akisute commented 9 years ago

I reproduced this bug when I use Tweaks on iPad, iOS 8.1. Looks like on iPad UITableView calls selectAllTableViewCell: private method when cells are selected (or deselected) and that's the reason why actions are invoked twice. We got to fix the code to use tableView:didSelectRowAtIndexPath: rather than setSelected:animated: of cells. I need to fix this quick for my project so after I've done patching I'm going to post a PR.

akisute commented 9 years ago

OK fixed in #57, but the workaround is not looking much pretty imo.

ghost commented 9 years ago

Thank you for reporting this issue and appreciate your patience. We've notified the core team for an update on this issue. We're looking for a response within the next 30 days or the issue may be closed.