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

[Bug] Crashes every time TextView grows if you don't declare textViewDidChangeHeight from the Delegate #8

Closed
nuno-vieira opened this issue Mar 17, 2017 · 3 comments

Comments

@nuno-vieira
Copy link

nuno-vieira commented Mar 17, 2017

If you don't define the textViewDidChangeHeight "optional" method from the delegate, it crashes. So i don't actually need that method from the delegate. So for now, i'm calling the method, but leave it empty.

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[Vilger.MessageViewController textViewDidChangeHeight:height:]: unrecognized selector sent to instance 0x7fc978d23720'
*** First throw call stack:
(
0 CoreFoundation 0x0000000109357d4b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x0000000108db921e objc_exception_throw + 48
2 CoreFoundation 0x00000001093c7f04 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3 CoreFoundation 0x00000001092dce1e forwarding + 526
4 CoreFoundation 0x00000001092dcb88 _CF_forwarding_prep_0 + 120
5 GrowingTextView 0x000000010574bcf6 TFC15GrowingTextView15GrowingTextView14layoutSubviewsfT_T + 1958
6 GrowingTextView 0x000000010574bf62 TToFC15GrowingTextView15GrowingTextView14layoutSubviewsfT_T + 34
7 UIKit 0x0000000106ca0ab8 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1237
8 QuartzCore 0x0000000105d5dbf8 -[CALayer layoutSublayers] + 146
9 QuartzCore 0x0000000105d51440 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 366
10 QuartzCore 0x0000000105d512be _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
11 QuartzCore 0x0000000105cdf318 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 280
12 QuartzCore 0x0000000105d0c3ff _ZN2CA11Transaction6commitEv + 475
13 QuartzCore 0x0000000105c677f7 _ZN2CA7Display11DisplayLink14dispatch_itemsEyyy + 611
14 CoreFoundation 0x00000001092e9db4 CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION + 20
15 CoreFoundation 0x00000001092e9a43 __CFRunLoopDoTimer + 1075
16 CoreFoundation 0x00000001092e95ca __CFRunLoopDoTimers + 250
17 CoreFoundation 0x00000001092e12f1 __CFRunLoopRun + 2065
18 CoreFoundation 0x00000001092e0884 CFRunLoopRunSpecific + 420
19 GraphicsServices 0x000000010c4fea6f GSEventRunModal + 161
20 UIKit 0x0000000106bdbc68 UIApplicationMain + 159
21 Vilger 0x000000010363e58f main + 111
22 libdyld.dylib 0x000000010aee568d start + 1
)

@nuno-vieira nuno-vieira changed the title Version 0.2.2 Crashes every time TextView grows [Bug] Version 0.2.2 Crashes every time TextView grows Mar 17, 2017
@nuno-vieira
Copy link
Author

nuno-vieira commented Mar 17, 2017

Update: I thought that is was happing only in version 0.2.2, but on version 0.2.1, it does the same

@nuno-vieira nuno-vieira changed the title [Bug] Version 0.2.2 Crashes every time TextView grows [Bug] Crashes every time TextView grows if you don't declare textViewDidChangeHeight Mar 17, 2017
@nuno-vieira nuno-vieira changed the title [Bug] Crashes every time TextView grows if you don't declare textViewDidChangeHeight [Bug] Crashes every time TextView grows if you don't declare textViewDidChangeHeight from the Delegate Mar 17, 2017
@KennethTsang
Copy link
Owner

I was wrongly unwrapping the optional delegate when calling it. It has been fixed. Thanks!

By the way, the delegate method has changed since 0.2.2:
textViewDidChangeHeight(_ textView: GrowingTextView, height: CGFloat)

@nuno-vieira
Copy link
Author

nuno-vieira commented Mar 19, 2017

No problem! Nice library, congratulations! I'll help whenever i can, and i'll be using it for sure, it is really handy ;)

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

2 participants