{ "id": "134169", "key": "ALOY-1110", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false }, "project": { "id": "11113", "key": "ALOY", "name": "Alloy", "projectCategory": { "id": "10400", "description": "Tools for developing applications", "name": "Tooling" } }, "fixVersions": [], "resolution": { "id": "3", "description": "The problem is a duplicate of an existing issue.", "name": "Duplicate" }, "resolutiondate": "2014-08-11T15:22:56.000+0000", "created": "2014-08-05T07:36:40.000+0000", "priority": null, "labels": [ "TCSupportTriage", "api", "feature" ], "versions": [], "issuelinks": [], "assignee": null, "updated": "2018-03-07T22:25:55.000+0000", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "13605", "name": "Models" } ], "description": "I have cases where I want to use only one single model for tableView data binding as below - one model for multiple rows...\r\n\r\n{code:title=\"index.xml\"}\r\n\r\n\t\r\n\t\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\r\n\r\n{code}\r\n\r\n{code:title=\"index.js\"}\r\nvar adidas = Alloy.Models.instance(\"adidas\");\r\n\r\nadidas.fetch({\r\n\t\"id\" : 39\r\n});\r\n$.index.open();\r\n{code}\r\n\r\n\r\nSee the attached screen dump that shows the result I wish to see\r\n\r\nHowever, the code snippet above crashes the app probably because such kind of way of data binding has not supported yet in Alloy - see error log\r\n\r\n\r\n\r\n{code:title=\"error\"}\r\n[ERROR] : The application has crashed with an uncaught exception 'NSInvalidArgumentException'.\r\n[ERROR] : Reason:\r\n[ERROR] : -[__NSCFNumber length]: unrecognized selector sent to instance 0xd98c520\r\n[ERROR] : Stack trace:\r\n[ERROR] : 0 CoreFoundation 0x042471c8 __exceptionPreprocess + 152\r\n[ERROR] : 1 libobjc.A.dylib 0x03f038e5 objc_exception_throw + 44\r\n[ERROR] : 2 CoreFoundation 0x042e4243 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275\r\n[ERROR] : 3 CoreFoundation 0x0423750b ___forwarding___ + 1019\r\n[ERROR] : 4 CoreFoundation 0x042370ee _CF_forwarding_prep_0 + 14\r\n[ERROR] : 5 UIKit 0x015dae86 -[UILabel _setTextColor:] + 222\r\n[ERROR] : 6 UIKit 0x015db030 -[UILabel setTextColor:] + 40\r\n[ERROR] : 7 alloyTabView 0x00154bdb -[TiUITableViewRowProxy configureTitle:] + 347\r\n[ERROR] : 8 alloyTabView 0x0015814a -[TiUITableViewRowProxy initializeTableViewCell:] + 138\r\n[ERROR] : 9 alloyTabView 0x000a6f90 -[TiUITableView tableView:cellForRowAtIndexPath:] + 944\r\n[ERROR] : 10 UIKit 0x0151811f -[UITableView _createPreparedCellForGlobalRow:withIndexPath:] + 412\r\n[ERROR] : 11 UIKit 0x015181f3 -[UITableView _createPreparedCellForGlobalRow:] + 69\r\n[ERROR] : 12 UIKit 0x014f9ece -[UITableView _updateVisibleCellsNow:] + 2428\r\n[ERROR] : 13 UIKit 0x0150e6a5 -[UITableView layoutSubviews] + 213\r\n[ERROR] : 14 UIKit 0x0148e964 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 355\r\n[ERROR] : 15 libobjc.A.dylib 0x03f1582b -[NSObject performSelector:withObject:] + 70\r\n[ERROR] : 16 QuartzCore 0x0308545a -[CALayer layoutSublayers] + 148\r\n[ERROR] : 17 QuartzCore 0x03079244 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380\r\n[ERROR] : 18 QuartzCore 0x030790b0 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 26\r\n[ERROR] : 19 QuartzCore 0x02fdf7fa _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 294\r\n[ERROR] : 20 QuartzCore 0x02fe0b85 _ZN2CA11Transaction6commitEv + 393\r\n[ERROR] : 21 QuartzCore 0x02fe1258 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 92\r\n[ERROR] : 22 CoreFoundation 0x0420f36e __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30\r\n[ERROR] : 23 CoreFoundation 0x0420f2bf __CFRunLoopDoObservers + 399\r\n[ERROR] : 24 CoreFoundation 0x041ed254 __CFRunLoopRun + 1076\r\n[ERROR] : 25 CoreFoundation 0x041ec9d3 CFRunLoopRunSpecific + 467\r\n[ERROR] : 26 CoreFoundation 0x041ec7eb CFRunLoopRunInMode + 123\r\n[ERROR] : 27 GraphicsServices 0x0459c5ee GSEventRunModal + 192\r\n[ERROR] : 28 GraphicsServices 0x0459c42b GSEventRun + 104\r\n[ERROR] : 29 UIKit 0x0141ff9b UIApplicationMain + 1225\r\n[ERROR] : 30 alloyTabView 0x00003d58 main + 456\r\n[ERROR] : 31 libdyld.dylib 0x04a00725 start + 0\r\n[ERROR] : 2014-08-05 17:34:10.978 alloyTabView[66297:90b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reaso\r\nn: '-[__NSCFNumber length]: unrecognized selector sent to instance 0xd98c520'\r\n[ERROR] : *** First throw call stack:\r\n[ERROR] : (\r\n[ERROR] : \t0 CoreFoundation 0x042471e4 __exceptionPreprocess + 180\r\n[ERROR] : \t1 libobjc.A.dylib 0x03f038e5 objc_exception_throw + 44\r\n[ERROR] : \t2 CoreFoundation 0x042e4243 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275\r\n[ERROR] : \t3 CoreFoundation 0x0423750b ___forwarding___ + 1019\r\n[ERROR] : \t4 CoreFoundation 0x042370ee _CF_forwarding_prep_0 + 14\r\n[ERROR] : \t5 UIKit 0x015dae86 -[UILabel _setTextColor:] + 222\r\n[ERROR] : \t6 UIKit 0x015db030 -[UILabel setTextColor:] + 40\r\n[ERROR] : \t7 alloyTabView 0x00154bdb -[TiUITableViewRowProxy configureTitle:] + 347\r\n[ERROR] : \t8 alloyTabView 0x0015814a -[TiUITableViewRowProxy initializeTableViewCell:] + 138\r\n[ERROR] : \t9 alloyTabView 0x000a6f90 -[TiUITableView tableView:cellForRowAtIndexPath:] + 944\r\n[ERROR] : \t10 UIKit 0x0151811f -[UITableView _createPreparedCellForGlobalRow:withIndexPath:] + 412\r\n[ERROR] : \t11 UIKit 0x015181f3 -[UITableView _createPreparedCellForGlobalRow:] + 69\r\n[ERROR] : \t12 UIKit 0x014f9ece -[UITableView _updateVisibleCellsNow:] + 2428\r\n[ERROR] : \t13 UIKit 0x0150e6a5 -[UITableView layoutSubviews] + 213\r\n[ERROR] : \t14 UIKit 0x0148e964 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 355\r\n[ERROR] : \t15 libobjc.A.dylib 0x03f1582b -[NSObject performSelector:withObject:] + 70\r\n[ERROR] : \t16 QuartzCore 0x0308545a -[CALayer layoutSublayers] + 148\r\n[ERROR] : \t17 QuartzCore 0x03079244 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380\r\n[ERROR] : \t18 QuartzCore 0x030790b0 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 26\r\n[ERROR] : \t19 QuartzCore 0x02fdf7fa _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 294\r\n[ERROR] : \t20 QuartzCore 0x02fe0b85 _ZN2CA11Transaction6commitEv + 393\r\n[ERROR] : \t21 QuartzCore 0x02fe1258 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 92\r\n[ERROR] : \t22 CoreFoundation 0x0420f36e __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30\r\n[ERROR] : \t23 CoreFoundation 0x0420f2bf __CFRunLoopDoObservers + 399\r\n[ERROR] : \t24 CoreFoundation 0x041ed254 __CFRunLoopRun + 1076\r\n[ERROR] : \t25 CoreFoundation 0x041ec9d3 CFRunLoopRunSpecific + 467\r\n[ERROR] : \t26 CoreFoundation 0x041ec7eb CFRunLoopRunInMode + 123\r\n[ERROR] : \t27 GraphicsServices 0x0459c5ee GSEventRunModal + 192\r\n[ERROR] : \t28 GraphicsServices 0x0459c42b GSEventRun + 104\r\n[ERROR] : \t29 UIKit 0x0141ff9b UIApplicationMain + 1225\r\n[ERROR] : \t30 alloyTabView 0x00003d58 main + 456\r\n[ERROR] : \t31 libdyld.dylib 0x04a00725 start + 0\r\n[ERROR] : )\r\n[ERROR] : libc++abi.dylib: terminating with uncaught exception of type NSException\r\n-- End simulator log ---------------------------------------------------------\r\n{code}\r\n\r\nNot sure if binding this way makes sense or not, but it is really useful in my case.\r\n\r\n", "attachment": [ { "id": "50231", "filename": "another_flavour_of_binding.png", "author": { "name": "jialhe85@gmail.com", "key": "jialhe85@gmail.com", "displayName": "David He", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-08-05T07:36:40.000+0000", "size": 43570, "mimeType": "image/png" } ], "flagged": false, "summary": "Another flavor of data binding in Alloy", "creator": { "name": "jialhe85@gmail.com", "key": "jialhe85@gmail.com", "displayName": "David He", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jialhe85@gmail.com", "key": "jialhe85@gmail.com", "displayName": "David He", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Alloy 1.4.1\r\nTiSDK 3.3.0\r\nIOS SIMULATOR 7.1.1", "comment": { "comments": [ { "id": "317356", "author": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "body": "Hello [~tlukasavage]! May you please assign to [~jialhe85@gmail.com] (David He) as the original reporter? TIA!", "updateAuthor": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "created": "2014-08-06T20:27:09.000+0000", "updated": "2014-08-06T20:27:09.000+0000" }, { "id": "317965", "author": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "body": "Appears to be a duplicate of ALOY-443 (Resolved/Fixed), which will be included in Alloy 1.5. ", "updateAuthor": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "created": "2014-08-11T15:22:56.000+0000", "updated": "2014-08-11T15:22:56.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }