-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash in ARC project when adding a target after setting .on property #26
Comments
I can confirm this behaviour as well. I solved it by setting the value AFTER the addTarget call. So [toggle addTarget:self action:@selector(aSelector:) forControlEvents:UIControlEventValueChanged];
toggle.on = someBoolean; |
@jyn 's solution worked. Thank you! |
thanks so much for this :) |
@jyn 's solution worked for me as well. Thank you indeed 👍 |
@jyn thank you so much ,, you saved mi day :) |
@jyn is my hero! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you add a target immediately after setting the "on" property, there's an EXC_BAD_ACCESS triggered when the switch slide animation completes.
E.g.
Perhaps something to do with the
[[self allTargets] makeObjectsPerformSelector:@selector(retain)];
and[[self allTargets] makeObjectsPerformSelector:@selector(release)];
in the property setter - i.e.[self allTargets]
is empty when the animation begins, but has the new target when the animation completes, causing an over-release?The text was updated successfully, but these errors were encountered: