{ "id": "112846", "key": "TIMOB-13557", "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": null, "resolutiondate": null, "created": "2013-04-15T10:05:01.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [], "versions": [], "issuelinks": [], "assignee": null, "updated": "2018-02-28T20:03:36.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "Q&A link to issue and solution.\r\n\r\nhttp://developer.appcelerator.com/question/146932/how-to-delete-an-array-of-annotations#answer-260727\r\n\r\n\r\nIn following code ENSURE_TYPE makes array with one element which is array of annotations.\r\n{code}\r\n\r\n-(void)removeAnnotations:(id)arg\r\n{\r\n\tENSURE_TYPE(arg,NSArray)\r\n for (id ann in arg) {\r\n if ([ann isKindOfClass:[TiMapAnnotationProxy class]]) {\r\n [self forgetProxy:ann];\r\n }\r\n }\r\n \r\n\tif ([self viewAttached]) {\r\n TiThreadPerformOnMainThread(^{\r\n [(TiMapView*)[self view] removeAnnotations:arg];\r\n }, NO);\r\n\t}\r\n\telse {\r\n\t\tfor (id annotation in arg) {\r\n\t\t\t[self removeAnnotation:annotation];\r\n\t\t}\r\n\t}\r\n}\r\n{code}\r\n\r\nto resolve it we must replace \r\n\r\n{code}\r\nENSURE_TYPE(arg,NSArray)\r\n{code}\r\n\r\nwith more correct\r\n\r\n{code}\r\nENSURE_SINGLE_ARG(arg,NSArray)\r\n{code}\r\n", "attachment": [], "flagged": false, "summary": "iOS: Ti.Map.View.removeAnnotations doesn't work + solution. ", "creator": { "name": "darknos", "key": "darknos", "displayName": "Sergey Nosenko", "active": true, "timeZone": "Europe/Helsinki" }, "subtasks": [], "reporter": { "name": "darknos", "key": "darknos", "displayName": "Sergey Nosenko", "active": true, "timeZone": "Europe/Helsinki" }, "environment": "iOS", "comment": { "comments": [], "maxResults": 0, "total": 0, "startAt": 0 } } }