{ "id": "82333", "key": "TIMOB-5990", "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": [ { "id": "11331", "description": "", "name": "Release 1.8.0", "archived": true, "released": true, "releaseDate": "2011-10-31" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-01-04T18:03:23.000+0000", "created": "2011-11-04T09:23:59.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "module_scrollableview", "qe-testadded" ], "versions": [ { "id": "11331", "description": "", "name": "Release 1.8.0", "archived": true, "released": true, "releaseDate": "2011-10-31" } ], "issuelinks": [ { "id": "13764", "type": { "id": "10001", "name": "Cloners", "inward": "is cloned into", "outward": "is cloned from" }, "inwardIssue": { "id": "82344", "key": "TIMOB-5996", "fields": { "summary": "Android: Modify ScrollableView.removeView() to support integer indexes", "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" } }, "priority": { "name": "Low", "id": "4" }, "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } } ], "assignee": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "updated": "2014-06-19T12:43:03.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": "h1. Problem\r\nScrollableView's \"removeView\" method accepts either a view or an index to a view, but passing in an index to a view results in an error being raised.\r\n\r\nh2. The Error\r\n{quote}\r\n2011-11-04 10:18:18.309 play[50939:1ab0b] -[__NSCFNumber krollObjectForBridge:]: unrecognized selector sent to instance 0x8c6d7a0\r\n[ERROR] Script Error = -[__NSCFNumber krollObjectForBridge:]: unrecognized selector sent to instance 0x8c6d7a0 at app.js (line 3).\r\n{quote}\r\n\r\nh2. Why This Happens\r\nIn TiScrollableViewProxy.m's removeView method, the \"doomedView\" is identified. But when we call self forgetProxy, we don't use the \"doomedView\", we use the \"args\", which will only be valid if a view was passed in, and not an integer.\r\n\r\nSee the following erroneous code, taken from 1.8.0 at the time of this ticket's inception: \r\n{code:title=TiScrollableViewProxy.m}\r\n[doomedView performSelectorOnMainThread:@selector(detachView) withObject:nil waitUntilDone:NO];\r\n[self forgetProxy:args];\r\n[viewProxies removeObject:args];\r\n[self unlockViews];\t\r\n{code}\r\n\r\nh2. Solution\r\nChange those two references to \"args\" to \"doomedView\", and everything works as it should.\r\n\r\nh2. How To Reproduce\r\nDrop the following in an app.js. If you get a modal error screen, the bug is present. If you don't, then everything is working as it should.\r\n\r\n{code:title=app.js}\r\nTi.UI.createScrollableView({\r\n views: [ Ti.UI.createView() ]\r\n}).removeView(0);\r\n{code}\r\n\r\nh2. Pull Request\r\nhttps://github.com/appcelerator/titanium_mobile/pull/629", "attachment": [], "flagged": false, "summary": "iOS: Scrollable View removeView(int) Causes Error", "creator": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "environment": null, "comment": { "comments": [ { "id": "171499", "author": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "body": "Added the pull request. A very simple fix...", "updateAuthor": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "created": "2011-11-04T09:28:57.000+0000", "updated": "2011-11-04T09:28:57.000+0000" }, { "id": "171529", "author": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "body": "Spun off [TIMOB-5996] for either adding this to Android and the docs, or removing it from iOS.", "updateAuthor": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "created": "2011-11-04T12:52:04.000+0000", "updated": "2011-11-04T12:52:04.000+0000" }, { "id": "175239", "author": { "name": "mpettiford", "key": "mpettiford", "displayName": "Michael Pettiford", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested on Ti Studio 1.0.7.201112061404\r\n
Ti Mob SDK 1.8.0.1.v20111207091653\r\n
OSX Lion\r\niPhone 4S OS 5.0.1\r\n\r\nExpected behavior is of no error being produced is shown", "updateAuthor": { "name": "mpettiford", "key": "mpettiford", "displayName": "Michael Pettiford", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-12-07T14:49:55.000+0000", "updated": "2011-12-07T14:49:55.000+0000" }, { "id": "178068", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Reopening bug to add tag", "updateAuthor": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-01-04T18:02:47.000+0000", "updated": "2012-01-04T18:02:47.000+0000" }, { "id": "178069", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Added tag.", "updateAuthor": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-01-04T18:03:23.000+0000", "updated": "2012-01-04T18:03:23.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }