{ "id": "172920", "key": "TIMOB-26772", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "8", "description": "", "name": "Needs more info" }, "resolutiondate": "2019-03-19T17:37:38.000+0000", "created": "2019-01-27T11:46:32.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [ "attributedString", "listView" ], "versions": [], "issuelinks": [], "assignee": { "name": "ahutton", "key": "ahutton", "displayName": "Alan Hutton", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2019-03-25T22:57:43.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "*Issue Description:*\r\nWhen I try to build a project using listView attributed string on iOS, it shows the following error on latest ti SDK 7.5.0.GA\r\n\r\n*Error Log:*\r\n{code}\r\nerror log:\r\n[ERROR] Script Error {\r\n[ERROR] column = 24;\r\n[ERROR] line = 89;\r\n[ERROR] message = \"Invalid type passed to function\";\r\n[ERROR] nativeLocation = \"-[TiUILabel setAttributedString_:] (TiUILabel.m:485)\";\r\n[ERROR] nativeReason = \"expected: TiUIAttributedStringProxy, was: NSNull\";\r\n[ERROR] nativeStack = \"3 listViewIssue 0x00000001094f3bdb -[TiUIView throwException:subreason:location:] + 107\\n4 listViewIssue 0x00000\r\n001095619a7 -[TiUILabel setAttributedString_:] + 503\\n5 listViewIssue 0x0000000109576cdf __DoProxyDelegateChangedValuesWithProxy_block_invoke.5\r\n4 + 47\\n6 listViewIssue 0x00000001095c005e TiThreadPerformOnMainThread + 78\\n7 listViewIssue 0x0000000109576bc5 DoProxyDelegateChangedValue\r\nsWithProxy + 853\\n8 listViewIssue 0x00000001094f8744 -[TiUIView propertyChanged:oldValue:newValue:proxy:] + 68\\n9 listViewIssue 0x000000010\r\n957c8aa -[TiProxy replaceValue:forKey:notification:] + 1114\\n10 listViewIssue 0x000000010957cabd -[TiProxy setValue:forUndefinedKey:] + 77\\n11 \r\nlistViewIssue 0x00000001094c5b96 -[TiViewProxy setValue:forUndefinedKey:] + 278\\n12 Foundation 0x000000010b8750b4 -[NSObject(NSKeyValueCoding) s\r\netValue:forKey:] + 292\\n13 Foundation 0x000000010b875909 -[NSObject(NSKeyValueCoding) setValue:forKeyPath:] + 271\\n14 listViewIssue 0x000000010\r\n972ac5e __28-[TiUIListItem setDataItem:]_block_invoke.338 + 206\\n15 CoreFoundation 0x0000000110115c2a -[__NSSetM enumerateObjectsWithOptions:usin\r\ngBlock:] + 218\\n16 listViewIssue 0x0000000109729eff -[TiUIListItem setDataItem:] + 4399\\n17 listViewIssue 0x000000010973e13a -[TiUIListView t\r\nableView:heightForRowAtIndexPath:] + 666\\n18 UIKitCore 0x000000011b177f2b -[UITableView _dataSourceHeightForRowAtIndexPath:] + 108\\n19 UIKitCore\r\n 0x000000011b1c78ba __66-[UISectionRowData refreshWithSection:tableView:tableViewRowData:]_block_invoke + 350\";\r\n[ERROR] sourceURL = \"file:///Users/user/Library/Developer/CoreSimulator/Devices/38370841-28B4-4E7C-8B1E-89D45DC29E2F/data/Containers/Bundle/App\r\nlication/325AB006-5B5A-4BCB-A0CE-95574C8D6B95/listViewIssue.app/alloy/controllers/index.js\";\r\n[ERROR] stack = \" at [native code]\\n at Controller(/alloy/controllers/index.js:89:24)\\n at createController(/alloy.js:339:52)\\n at \r\n(/app.js:11:23)\\n at global code(/app.js:13:70)\\n at require@[native code]\\n at (/ti.main.js:27:10)\\n at loadAsync(/ti.internal/bootstr\r\nap.loader.js:106:11)\\n at global code(/ti.main.js:24:52)\";\r\n[ERROR] toJSON = \"\";\r\n[ERROR] } \r\n[ERROR] Script Error Module \"app.js\" failed to leave a valid exports object\r\n[DEBUG] Application booted in 646.753073 ms\r\n[ERROR] The application has crashed with an uncaught exception 'org.listviewissue.TiUILabel'.\r\n[ERROR] Reason:\r\n[ERROR] Invalid type passed to function\r\n[ERROR] Stack trace:\r\n[ERROR] 0 CoreFoundation 0x00000001101a729b __exceptionPreprocess + 331\r\n[ERROR] 1 libobjc.A.dylib 0x000000010efc8735 objc_exception_throw + 48\r\n[ERROR] 2 listViewIssue 0x00000001095bfdad TiExceptionThrowWithNameAndReason + 141\r\n[ERROR] 3 listViewIssue 0x00000001094f3bdb -[TiUIView throwException:subreason:location:] + 107\r\n[ERROR] 4 listViewIssue 0x00000001095619a7 -[TiUILabel setAttributedString_:] + 503\r\n[ERROR] 5 listViewIssue 0x0000000109576cdf __DoProxyDelegateChangedValuesWithProxy_block_invoke.54 + 47\r\n[ERROR] 6 listViewIssue 0x00000001095c005e TiThreadPerformOnMainThread + 78\r\n[ERROR] 7 listViewIssue 0x0000000109576bc5 DoProxyDelegateChangedValuesWithProxy + 853\r\n[ERROR] 8 listViewIssue 0x00000001094f8744 -[TiUIView propertyChanged:oldValue:newValue:proxy:] + 68\r\n[ERROR] 9 listViewIssue 0x000000010957c8aa -[TiProxy replaceValue:forKey:notification:] + 1114\r\n[ERROR] 10 listViewIssue 0x000000010957cabd -[TiProxy setValue:forUndefinedKey:] + 77\r\n[ERROR] 11 listViewIssue 0x00000001094c5b96 -[TiViewProxy setValue:forUndefinedKey:] + 278\r\n[ERROR] 12 Foundation 0x000000010b8750b4 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 292\r\n[ERROR] 13 Foundation 0x000000010b875909 -[NSObject(NSKeyValueCoding) setValue:forKeyPath:] + 271\r\n[ERROR] 14 listViewIssue 0x000000010972ac5e __28-[TiUIListItem setDataItem:]_block_invoke.338 + 206\r\n[ERROR] 15 CoreFoundation 0x0000000110115c2a -[__NSSetM enumerateObjectsWithOptions:usingBlock:] + 218\r\n[ERROR] 16 listViewIssue 0x0000000109729eff -[TiUIListItem setDataItem:] + 4399\r\n[ERROR] 17 listViewIssue 0x000000010973e13a -[TiUIListView tableView:heightForRowAtIndexPath:] + 666\r\n[ERROR] 18 UIKitCore 0x000000011b177f2b -[UITableView _dataSourceHeightForRowAtIndexPath:] + 108\r\n[ERROR] 19 UIKitCore 0x000000011b1c78ba __66-[UISectionRowData refreshWithSection:tableView:tableViewRowData:]_block_inv\r\noke + 350\r\n[ERROR] 20 UIKitCore 0x000000011b1c7112 -[UISectionRowData refreshWithSection:tableView:tableViewRowData:] + 3281\r\n[ERROR] 21 UIKitCore 0x000000011b1cd151 -[UITableViewRowData rectForFooterInSection:heightCanBeGuessed:] + 487\r\n[ERROR] 22 UIKitCore 0x000000011b1cd2b7 -[UITableViewRowData heightForTable] + 61\r\n[ERROR] 23 UIKitCore 0x000000011b12698f -[UITableView _updateContentSize] + 354\r\n[ERROR] 24 UIKitCore 0x000000011b14d587 -[UITableView setTableHeaderView:] + 466\r\n[ERROR] 25 listViewIssue 0x0000000109732413 __33-[TiUIListView proxyDidRelayout:]_block_invoke + 307\r\n[ERROR] 26 libdispatch.dylib 0x00000001116b951d _dispatch_call_block_and_release + 12\r\n[ERROR] 27 libdispatch.dylib 0x00000001116ba587 _dispatch_client_callout + 8\r\n[ERROR] 28 libdispatch.dylib 0x00000001116c63bc _dispatch_main_queue_callback_4CF + 1290\r\n[ERROR] 29 CoreFoundation 0x000000011010a7f9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9\r\n[ERROR] 30 CoreFoundation 0x0000000110104e86 __CFRunLoopRun + 2342\r\n[ERROR] 31 CoreFoundation 0x0000000110104221 CFRunLoopRunSpecific + 625\r\n[ERROR] 32 GraphicsServices 0x00000001133531dd GSEventRunModal + 62\r\n[ERROR] 33 UIKitCore 0x000000011abf6115 UIApplicationMain + 140\r\n[ERROR] 34 listViewIssue 0x000000010948c263 main + 115\r\n[ERROR] 35 libdyld.dylib 0x000000011172a551 start + 1\r\n-- End simulator log ---------------------------------------------------------\r\nusers-MacBook-Pro-2:listViewIssue user$ \r\n{code}\r\n\r\n*Steps to Reproduce:*\r\n1. Replace index.xml, index.js, index.tss with the following test code.\r\n*index.xml*\r\n{code}\r\n\r\n\t\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\r\n\r\n{code}\r\n\r\n*index.js*\r\n{code}\r\nvar listSection = Ti.UI.createListSection();\r\nvar dataItems = [];\r\n\r\nfor (var i = 0; i < 100; i++) {\r\n\r\n\tvar data = {\r\n\t\ttemplate : \"simpleLabel\",\r\n\t\tlabel1 : {},\r\n\t};\r\n\r\n\tif (i % 2 === 1) {\r\n\r\n\t\tdata.label1.attributedString = Ti.UI.createAttributedString({\r\n\t\t\ttext : \"Italic row row row\" + i,\r\n\t\t\tattributes : [{\r\n\t\t\t\ttype : Ti.UI.ATTRIBUTE_FONT,\r\n\t\t\t\tvalue : {\r\n\t\t\t\t\tfontWeight : \"normal\",\r\n\t\t\t\t\tfontStyle : \"italic\",\r\n\t\t\t\t},\r\n\t\t\t\trange : [0, 6],\r\n\t\t\t}]\r\n\t\t});\r\n\r\n\t} else {\r\n\t\t//data.label1.text = \"Normal\";\r\n\t\tdata.label1.text = \"Normal\" + i;\r\n\t}\r\n\r\n\tdataItems.push(data);\r\n};\r\nlistSection.setItems(dataItems);\r\n$.listView.setSections([listSection]);\r\n$.index.open(); \r\n{code}\r\n\r\n*index.tss*\r\n{code}\r\n\".container\": {\r\n\tbackgroundColor: \"#fff\",\r\n\tlayout: \"vertical\",\r\n}\r\n \r\n\"#listView\": {\r\n\theight: Ti.UI.FILL,\r\n\twidth: Ti.UI.FILL,\r\n}\r\n\"#label1\": {\r\n\tfont: {\r\n\t\tfontSize: 26,\r\n\t},\r\n\tcolor: \"#000\",\r\n}\r\n \r\n\"Label\": {\r\n\tcolor: \"#000\",\r\n\tfont: {\r\n\t\tfontSize: 30,\r\n\t},\r\n}\r\n{code}\r\n\r\n2. Build the project on iOS simulator and observe the error.\r\n\r\n*Expected:* ListView attributed string should work\r\n*Actual:* It doesn't work, generates the said error.\r\n", "attachment": [], "flagged": false, "summary": "iOS: ListView with attributed strings shows \"Invalid type passed to function\" error.", "creator": { "name": "jnaher", "key": "jnaher", "displayName": "Jebun Naher", "active": false, "timeZone": "Asia/Dhaka" }, "subtasks": [], "reporter": { "name": "jnaher", "key": "jnaher", "displayName": "Jebun Naher", "active": false, "timeZone": "Asia/Dhaka" }, "environment": "Appcelerator Command-Line Interface, version 7.0.9\r\nAxway Appcelerator Studio, build: 5.1.1.201809051655\r\nOperating System\r\n Name = Mac OS X\r\n Version = 10.13.6\r\n\r\nNode.js\r\n Node.js Version = 8.9.1\r\n npm Version = 5.5.1\r\n\r\nAppcelerator CLI\r\n Installer = 4.2.13\r\n Core Package = 7.0.9\r\n\r\nTitanium CLI\r\n CLI Version = 5.1.1\r\n node-appc Version = 0.2.44\r\n\r\nTitanium SDKs = 7.5.0\r\n\r\niOS Simulator = iOS 12(iPhone 7plus)", "comment": { "comments": [ { "id": "445681", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "If one label uses a text and one uses attributed strings, you should consider using two templates instead. That's what we use and it works good.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2019-01-27T18:57:29.000+0000", "updated": "2019-01-27T18:57:29.000+0000" }, { "id": "446979", "author": { "name": "ahutton", "key": "ahutton", "displayName": "Alan Hutton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "As this issue has been closed in intercom for not getting customer reply, we can close this issue for now. ", "updateAuthor": { "name": "ahutton", "key": "ahutton", "displayName": "Alan Hutton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-03-19T17:37:38.000+0000", "updated": "2019-03-19T17:37:38.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }