Skip to content
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

When I clicked on the button, there was an error. #25

Open
rongloveyan opened this issue Apr 13, 2016 · 3 comments
Open

When I clicked on the button, there was an error. #25

rongloveyan opened this issue Apr 13, 2016 · 3 comments

Comments

@rongloveyan
Copy link

2016-04-13 18:29:02.168 DOFavoriteButton-DEMO[1303:41281] -[DOFavoriteButton.DOFavoriteButton select:]: unrecognized selector sent to instance 0x7fd032c361b0
2016-04-13 18:29:02.172 DOFavoriteButton-DEMO[1303:41281] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[DOFavoriteButton.DOFavoriteButton select:]: unrecognized selector sent to instance 0x7fd032c361b0'
*** First throw call stack:
(
0 CoreFoundation 0x000000010e415d85 exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000110881deb objc_exception_throw + 48
2 CoreFoundation 0x000000010e41ed3d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x000000010e364cfa __forwarding
+ 970
4 CoreFoundation 0x000000010e3648a8 _CF_forwarding_prep_0 + 120
5 DOFavoriteButton 0x0000000110cc6215 TFC16DOFavoriteButton16DOFavoriteButton6selectfT_T + 69
6 DOFavoriteButton-DEMO 0x000000010e22f4d3 TFC21DOFavoriteButton_DEMO14ViewController12tappedButtonfC16DOFavoriteButton16DOFavoriteButtonT + 99
7 DOFavoriteButton-DEMO 0x000000010e22f52a TToFC21DOFavoriteButton_DEMO14ViewController12tappedButtonfC16DOFavoriteButton16DOFavoriteButtonT + 58
8 UIKit 0x000000010f307a8d -[UIApplication sendAction:to:from:forEvent:] + 92
9 UIKit 0x000000010f47ae67 -[UIControl sendAction:to:forEvent:] + 67
10 UIKit 0x000000010f47b143 -[UIControl _sendActionsForEvents:withEvent:] + 327
11 UIKit 0x000000010f47a263 -[UIControl touchesEnded:withEvent:] + 601
12 UIKit 0x000000010f37a99f -[UIWindow _sendTouchesForEvent:] + 835
13 UIKit 0x000000010f37b6d4 -[UIWindow sendEvent:] + 865
14 UIKit 0x000000010f326dc6 -[UIApplication sendEvent:] + 263
15 UIKit 0x000000010f300553 _UIApplicationHandleEventQueue + 6660
16 CoreFoundation 0x000000010e33b301 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17
17 CoreFoundation 0x000000010e33122c __CFRunLoopDoSources0 + 556
18 CoreFoundation 0x000000010e3306e3 __CFRunLoopRun + 867
19 CoreFoundation 0x000000010e3300f8 CFRunLoopRunSpecific + 488
20 GraphicsServices 0x0000000113edbad2 GSEventRunModal + 161
21 UIKit 0x000000010f305f09 UIApplicationMain + 171
22 DOFavoriteButton-DEMO 0x000000010e2303b2 main + 114
23 libdyld.dylib 0x000000011136592d start + 1
24 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)

@cyhsutw
Copy link

cyhsutw commented Apr 13, 2016

I guess the problem here is the implementation of select is calling another method called select: of UIResponder (since UIButton is one of its subclasses).

To resolve the issue for now, you may try to call select(animate:) instead:

// for Objective-C
[myButton selectWithAnimate: YES];
// for Swift
myButton.select(animate: true)

cyhsutw added a commit to HopApp/DOFavoriteButton that referenced this issue Apr 13, 2016
Fixes okmr-d#25.

Cause: the orginal implementation of `select` is calling a method defined in `UIResponder` not our animation method.
cyhsutw added a commit to HopApp/DOFavoriteButton that referenced this issue Apr 13, 2016
Fixes okmr-d#25.

Cause: the original implementation of `select` is calling a method defined in `UIResponder` not our animation method.
@iThanh
Copy link

iThanh commented Apr 14, 2016

Thank you!

@galharth
Copy link

galharth commented Jul 17, 2016

@cyhsutw I can't add the animate:true to the select?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants