devxoul / UITextView-Placeholder

A missing placeholder for UITextView
MIT License
1.48k stars 259 forks source link

Crash when using on TestFlight on iOS 13 #69

Closed ahmedk92 closed 5 years ago

ahmedk92 commented 5 years ago

Backtrace:

Last Exception Backtrace:
0   CoreFoundation                  0x180afc98c __exceptionPreprocess + 220 (NSException.m:199)
1   libobjc.A.dylib                 0x1808250a4 objc_exception_throw + 56 (objc-exception.mm:565)
2   CoreFoundation                  0x1809f2054 +[NSException raise:format:] + 108 (NSException.m:155)
3   UIKitCore                       0x184e4efe8 UIKVCAccessProhibited + 284 (UIDebug.m:26)
4   UIKitCore                       0x184dcd6f4 -[UITextField valueForKey:] + 96 (UITextField.m:3523)
5   Foundation                      0x180db7778 -[NSObject(NSKeyValueCoding) valueForKeyPath:] + 248 (NSKeyValueCoding.m:511)
6   UITextView_Placeholder          0x1013f4d64 __50+[UITextView(Placeholder) defaultPlaceholderColor]_block_invoke + 84 (UITextView+Placeholder.m:62)
7   libdispatch.dylib               0x1807ca184 _dispatch_client_callout + 16 (object.m:495)
8   libdispatch.dylib               0x18079cf7c _dispatch_once_callout + 28 (once.c:52)
9   UITextView_Placeholder          0x1013f4d08 +[UITextView(Placeholder) defaultPlaceholderColor] + 56 (once.h:84)
10  UITextView_Placeholder          0x1013f4f24 -[UITextView(Placeholder) placeholderLabel] + 216 (UITextView+Placeholder.m:92)
11  UITextView_Placeholder          0x1013f51b4 -[UITextView(Placeholder) setPlaceholder:] + 52 (UITextView+Placeholder.m:121)
devxoul commented 5 years ago

Which version of the library are you using?

ahmedk92 commented 5 years ago

1.3.3

vsevolod-sp commented 5 years ago

*** Terminating app due to uncaught exception 'NSGenericException', reason: 'Access to UITextField's _placeholderLabel ivar is prohibited. This is an application bug' *** First throw call stack: (0x1958dc98c 0x1956050a4 0x1957d2054 0x199c2efe8 0x199bad6f4 0x195b97778 0x101af0708 0x104406c04 0x1044084f4 0x101af065c 0x101af0950 0x101af0d68 0x195bbf480 0x199d747d0 0x19959614c 0x1957b6ddc 0x199595bfc 0x1992dcb4c 0x1992dd5d8 0x1992dd890 0x1992ddf94 0x19923d804 0x199250de8 0x1992522ec 0x199236060 0x199d75270 0x19c2615f8 0x19c265e28 0x19c271894 0x19c1ba9f0 0x19c1e4890 0x19c1e5284 0x195859c48 0x195854b34 0x195855100 0x1958548bc 0x19f6c0328 0x1998ea6d4 0x100b9f370 0x1956df460) libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)

devxoul commented 5 years ago

@ahmedk92, that is weird. There is no usage of value(forKey:) in 1.3.3. How did you install the library?

devxoul commented 5 years ago

@vsevolod-sp are you using the latest version of the library? UITextView+Placeholder doesn't access to _placeholderLabel anymore.

ahmedk92 commented 5 years ago

Via CocoaPods: pod 'UITextView+Placeholder'

vsevolod-sp commented 5 years ago

Latest version (1.2.1 or 1.2.2), problem appeared in iOS 13

devxoul commented 5 years ago

@ahmedk92 can you share your Podfile.lock? @vsevolod-sp the latest version is 1.3.3.

ahmedk92 commented 5 years ago

Weird. I checked it now and it's UITextView+Placeholder (1.2.1) in the Podfile.lock file. I believe I was using the 1.3.3 version. However, It's weekend here, and I'm returning on Monday. I'll then retry and report to you.

alexsafe commented 5 years ago

Any solution for this yet? Edit: did a clean after updating the pod - to 1.3.3 and it worked fine. (if anyone else freaks out in the future)

jlubeck commented 5 years ago

Was having the same crash as OP and I can confirm updating to latest 1.3.3 solves the problem This issue should be closed

devxoul commented 5 years ago

Please reopen this issue if you still have the problem after upgrading the library to 1.3.3 and clean build.