Titanium JIRA Archive
Appcelerator Community (AC)

[AC-6424] Setting TextField - hintTextColor in app.tss crashes app

GitHub Issuen/a
TypeBug
Priorityn/a
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
LabelsIOS,, TextField, hintText
ReporterThomas Neerup
AssigneeShak Hossain
Created2019-10-30T08:04:02.000+0000
Updated2019-11-06T16:10:00.000+0000

Description

Because of the new dark mode in xCode 11 i wanted to set the hintTextColor for all my TextField's but setting:
"TextField[platform=ios]": {
	hintTextColor: 'gray'
}
in app.tss Crashes the app in IOS when some of the TextField's do not have hintText.
[ERROR] :  Script Error {
[ERROR] :      column = 37;
[ERROR] :      line = 302;
[ERROR] :      message = "NSConcreteAttributedString initWithString:: nil value";
[ERROR] :      nativeStack = "3   Foundation 0x00007fff2574efcd -[NSConcreteAttributedString initWithString:attributes:] + 27\n4   Crosspaddev0x0000000102c666ca -[TiUITextField setHintTextColor_:] + 330\n5   TitaniumKit0x00000001038d729a DoProxyDelegateReadValuesWithKeysFromProxy + 607\n6   TitaniumKit0x00000001038ba593 -[TiViewProxy firePropertyChanges] + 92\n7   TitaniumKit0x00000001038b8bef -[TiViewProxy view] + 249\n8   Crosspaddev0x0000000102c46302 -[TiUITextWidgetProxy setKeyboardToolbar:] + 3874\n9   Foundation 0x00007fff2563e130 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 325\n10  TitaniumKit0x00000001038d9e89 -[TiProxy setValuesForKeysWithDictionary:] + 1886\n11  CoreFoundation  0x00007fff23bb138c __invoking___ + 140\n12  CoreFoundation  0x00007fff23bae49f -[NSInvocation invoke] + 319\n13  TitaniumKit0x00000001038d62c3 -[KrollMethod call:] + 1385\n14  TitaniumKit0x00000001038d54f7 __KrollCallAsFunction_block_invoke + 30\n15  TitaniumKit0x00000001038d5311 KrollCallAsFunction + 425\n16  JavaScriptCore  0x00007fff269a38ec _ZN3JSC16JSCallbackObjectINS_20JSDestructibleObjectEE4callEPNS_9ExecStateE + 524\n17  JavaScriptCore  0x00007fff26e77ffd _ZN3JSC5LLInt9setUpCallEPNS_9ExecStateENS_22CodeSpecializationKindENS_7JSValueEPNS_17LLIntCallLinkInfoE + 365\n18  JavaScriptCore  0x00007fff2696aa05 llint_entry + 93212\n19  ???   0x00005a0c8f469cf3 0x0 + 99009989876979\n20  JavaScriptCore  0x00007fff2696aa13 llint_entry + 93226\n21  JavaScriptCore  0x00007fff2696aa13 llint_entry + 93226\n22  JavaScriptCore  0x00007fff2696aa13 llint_entry + 93226";
[ERROR] :     

Comments

  1. Rene Pot 2019-10-31

    Hi! I tried to reproduce but got error in general when setting it to grey. However, it worked fine when setting it to #666. Can you confirm this?
  2. Thomas Neerup 2019-10-31

    No ... The problem is not the color but the fact that I'm setting the hintTextColor on all TextField's and some off them do not have a hintText
  3. Sharif AbuDarda 2019-11-03

    Hello [~thomas.neerup@eg.dk], So, the hintTextColor was workin for you when setting as hexadecimal color code? If so, I believe there is no issue here. Thanks.
  4. Rene Pot 2019-11-06

    [~thomas.neerup@eg.dk] What I meant with that, I got the same issue as you, but when setting it globally using a hex color it didn't cause any issues on my side. Can you try setting a hex color like #666 instead of gray
  5. Thomas Neerup 2019-11-06

    Rene Pot Below code stille causes my app to crash with "NSConcreteAttributedString initWithString:: nil value";
       "TextField[platform=ios]" : {
       	color: '#000000',
       	hintTextColor: '#808080'
       }
       
  6. Rene Pot 2019-11-06

    Hi [~thomas.neerup@eg.dk], I have this below and I don't have a crash. I use 8.2.1.GA SDK and iOS 13.1 simulator.
       ".tf": {
       	backgroundColor: "#bbb",
       	height: 50,
       	width: 300,
       	top: 10
       }
       
       ".hint": {
       	hintText: "Fill me in"
       }
       
       "TextField": {
       	hintTextColor: "#080808"
       }
       
       		<TextField class="tf" ></TextField>
       		<TextField class="tf" ></TextField>
       		<TextField class="tf hint" ></TextField>
       		<TextField class="tf hint" ></TextField>
       		<TextField class="tf hint" ></TextField>
       
  7. Thomas Neerup 2019-11-06

    I'm sorry. It looks like it was a combination of hintTextColor: '#80808' and a hintText = null (set in code, a simple null check fixed it) Guess this bug could be closed.. But I still think it is a bug that hintTextColor: 'gray' crashes the app :)

JSON Source