{ "id": "162729", "key": "TIMOB-23798", "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": "18253", "name": "Release 5.5.0", "archived": false, "released": true, "releaseDate": "2016-09-13" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2016-08-23T22:06:53.000+0000", "created": "2016-08-22T15:51:52.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "qe-5.5.0" ], "versions": [ { "id": "18253", "name": "Release 5.5.0", "archived": false, "released": true, "releaseDate": "2016-09-13" } ], "issuelinks": [ { "id": "52502", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "162720", "key": "TIMOB-23797", "fields": { "summary": "iOS: Improve Pasteboard support", "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": "High", "id": "2" }, "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } } ], "assignee": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2016-09-01T22:23:53.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": "Trying to clear all Pasteboard data with {{Ti.UI.Clipboard.clearData()}} (with no MIME type provided) crashes the app with the below error.\r\nEither our documentation is incorrect or {{clearData}} should be able to handle 'no arguments'.\r\n\r\n*Steps to reproduce issue*\r\n1. Create a new project\r\n2. Add {{Ti.UI.Clipboard.clearData()}} to the code\r\n3. Run the project\r\n\r\n*Expected Results*\r\nThe Pasteboard data is cleared without issue\r\n\r\n*Actual Results*\r\nThe app crashes with the below error\r\n\r\n*Error*\r\n{code}\r\n[ERROR] : The application has crashed with an uncaught exception 'NSInvalidArgumentException'.\r\n[ERROR] : Reason:\r\n[ERROR] : *** -[NSMutableOrderedSet addObject:]: object cannot be nil\r\n[ERROR] : Stack trace:\r\n[ERROR] : \r\n[ERROR] : 0 CoreFoundation 0x0000000109b8f333 __exceptionPreprocess + 147\r\n[ERROR] : 1 libobjc.A.dylib 0x000000010915f21e objc_exception_throw + 48\r\n[ERROR] : 2 CoreFoundation 0x0000000109b26f7c -[NSMutableOrderedSet addObject:] + 172\r\n[ERROR] : 3 Pasteboard 0x000000011f1b948c -[PBItem itemQueue_addRepresentationType:protectAgainstLargeDataSizes:loaderBlock:] + 156\r\n[ERROR] : 4 Pasteboard 0x000000011f1ba0b3 __44-[PBItem addRepresentationType:loaderBlock:]_block_invoke + 51\r\n[ERROR] : 5 libdispatch.dylib 0x000000010aa0b12e _dispatch_client_callout + 8\r\n[ERROR] : 6 libdispatch.dylib 0x000000010a9ef6ec _dispatch_barrier_sync_f_invoke + 119\r\n[ERROR] : 7 Pasteboard 0x000000011f1ba00d -[PBItem addRepresentationType:loaderBlock:] + 237\r\n[ERROR] : 8 UIKit 0x00000001055eeb6f -[_UIConcretePasteboard setData:forPasteboardType:] + 196\r\n[ERROR] : 9 PasteboardCheck 0x0000000102969cfb -[TiUIClipboardProxy clearData:] + 971\r\n[ERROR] : 10 CoreFoundation 0x0000000109b1605c __invoking___ + 140\r\n[ERROR] : 11 CoreFoundation 0x0000000109b15ee1 -[NSInvocation invoke] + 289\r\n[ERROR] : 12 PasteboardCheck 0x000000010277d39d -[KrollMethod call:] + 2045\r\n[ERROR] : 13 PasteboardCheck 0x000000010277bc71 __KrollCallAsFunction_block_invoke + 49\r\n[ERROR] : 14 PasteboardCheck 0x00000001028740fd TiThreadPerformOnMainThread + 77\r\n[ERROR] : 15 PasteboardCheck 0x000000010277b91e KrollCallAsFunction + 702\r\n[ERROR] : 16 PasteboardCheck 0x0000000102b0044d _ZN2TI16JSCallbackObjectINS_20JSDestructibleObjectEE4callEPNS_9ExecStateE + 493\r\n[ERROR] : 17 PasteboardCheck 0x0000000102ba3577 _ZN2TI5LLInt9setUpCallEPNS_9ExecStateEPNS_11InstructionENS_22CodeSpecializationKindENS_7TiValueEPNS_17LLIntCallLinkInfoE + 503\r\n[ERROR] : 18 PasteboardCheck 0x0000000102ba7fad llint_op_call + 148\r\n[ERROR] : \r\n[ERROR] : 2016-08-22 08:42:48.831 PasteboardCheck[20144:8684968] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSMutableOrderedSet addObject:]: object cannot be nil'\r\n[ERROR] : *** First throw call stack:\r\n[ERROR] : (\r\n[ERROR] : \t0 CoreFoundation 0x0000000109b8f34b __exceptionPreprocess + 171\r\n[ERROR] : \t1 libobjc.A.dylib 0x000000010915f21e objc_exception_throw + 48\r\n[ERROR] : \t2 CoreFoundation 0x0000000109b26f7c -[NSMutableOrderedSet addObject:] + 172\r\n[ERROR] : \t3 Pasteboard 0x000000011f1b948c -[PBItem itemQueue_addRepresentationType:protectAgainstLargeDataSizes:loaderBlock:] + 156\r\n[ERROR] : \t4 Pasteboard 0x000000011f1ba0b3 __44-[PBItem addRepresentationType:loaderBlock:]_block_invoke + 51\r\n[ERROR] : \t5 libdispatch.dylib 0x000000010aa0b12e _dispatch_client_callout + 8\r\n[ERROR] : \t6 libdispatch.dylib 0x000000010a9ef6ec _dispatch_barrier_sync_f_invoke + 119\r\n[ERROR] : \t7 Pasteboard 0x000000011f1ba00d -[PBItem addRepresentationType:loaderBlock:] + 237\r\n[ERROR] : \t8 UIKit 0x00000001055eeb6f -[_UIConcretePasteboard setData:forPasteboardType:] + 196\r\n[ERROR] : \t9 PasteboardCheck 0x0000000102969cfb -[TiUIClipboardProxy clearData:] + 971\r\n[ERROR] : \t10 CoreFoundation 0x0000000109b1605c __invoking___ + 140\r\n[ERROR] : \t11 CoreFoundation 0x0000000109b15ee1 -[NSInvocation invoke] + 289\r\n[ERROR] : \t12 PasteboardCheck 0x000000010277d39d -[KrollMethod call:] + 2045\r\n[ERROR] : \t13 PasteboardCheck 0x000000010277bc71 __KrollCallAsFunction_block_invoke + 49\r\n[ERROR] : \t14 PasteboardCheck 0x00000001028740fd TiThreadPerformOnMainThread + 77\r\n[ERROR] : \t15 PasteboardCheck 0x000000010277b91e KrollCallAsFunction + 702\r\n[ERROR] : \t16 PasteboardCheck 0x0000000102b0044d _ZN2TI16JSCallbackObjectINS_20JSDestructibleObjectEE4callEPNS_9ExecStateE + 493\r\n[ERROR] : \t17 PasteboardCheck 0x0000000102ba3577 _ZN2TI5LLInt9setUpCallEPNS_9ExecStateEPNS_11InstructionENS_22CodeSpecializationKindENS_7TiValueEPNS_17LLIntCallLinkInfoE + 503\r\n[ERROR] : \t18 PasteboardCheck 0x0000000102ba7fad llint_op_call + 148\r\n[ERROR] : )\r\n[ERROR] : libc++abi.dylib: terminating with uncaught exception of type NSException\r\n[TRACE] : [PasteboardCheck] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSMutableOrderedSet addObject:]: object cannot be nil'\r\n{code}\r\n\r\n*Notes*\r\nI also get an error when trying to clear a specific data, using a MIME type that I set the data with. For example: I can set data with {{Ti.UI.Clipboard.setData(\"colors\", \"blue\");}} but get the below error when trying to clear data with {{Ti.UI.Clipboard.clearData(\"colors\");}}\r\n{code}\r\n[ERROR] : Script Error {\r\n[ERROR] : column = 34;\r\n[ERROR] : line = 12;\r\n[ERROR] : message = \"-[__NSArrayM lowercaseString]: unrecognized selector sent to instance 0x608000244710\";\r\n[ERROR] : sourceURL = \"file:///Users/Eric/Library/Developer/CoreSimulator/Devices/83A39029-8DC3-4231-90FA-C9394BF09F69/data/Containers/Bundle/Application/71392209-38A2-43CD-8D82-B7EC530DBC52/PasteboardCheck.app/alloy/controllers/index.js\";\r\n[ERROR] : stack = \"[native code]\\ndoSet@file:///Users/Eric/Library/Developer/CoreSimulator/Devices/83A39029-8DC3-4231-90FA-C9394BF09F69/data/Containers/Bundle/Application/71392209-38A2-43CD-8D82-B7EC530DBC52/PasteboardCheck.app/alloy/controllers/index.js:12:34\";\r\n[ERROR] : }\r\n{code}", "attachment": [], "flagged": false, "summary": "iOS: Ti.UI.Clipboard.clearData() crashes when no MIME type is provided", "creator": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "environment": "MacOS 10.12 (16A239m)\r\nTi SDK 5.5.0.v20160822000355\r\nAppc NPM 4.2.7\r\nAppc CLI 5.5.0-5\r\nAlloy 1.9.1\r\nXcode 8.0 (8S201h)", "closedSprints": [ { "id": 695, "state": "closed", "name": "2016 Sprint 17 SDK", "startDate": "2016-08-13T00:00:16.620Z", "endDate": "2016-08-27T00:00:00.000Z", "completeDate": "2016-08-29T03:18:08.942Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "393925", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Just checked. We allow the value to be nil ({{ENSURE_STRING_OR_NIL}}) but then access it ({{NSString *mimeType = arg;}} afterwards. I would set the mimetype to unknown (like done when the specified mimetype is unrecognized). Is that a proper fix for you?", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-08-23T11:51:27.000+0000", "updated": "2016-08-23T11:51:27.000+0000" }, { "id": "393926", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "PR: https://github.com/appcelerator/titanium_mobile/pull/8252\r\nPR (5_5_X): https://github.com/appcelerator/titanium_mobile/pull/8291\r\nPR (6_0_X: https://github.com/appcelerator/titanium_mobile/pull/8292\r\n\r\nDemo:\r\n{code:javascript}\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: \"#fff\"\r\n});\r\nvar btn = Ti.UI.createButton({\r\n title: \"Clear data\"\r\n});\r\n\r\nbtn.addEventListener(\"click\", function() {\r\n Ti.UI.Clipboard.clearData()\r\n});\r\n\r\nwin.add(btn);\r\nwin.open();\r\n{code}", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-08-23T12:23:55.000+0000", "updated": "2016-08-31T17:00:08.000+0000" }, { "id": "394966", "author": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Verified fixed, using:\r\nMacOS 10.12 (16A239m)\r\nStudio 4.7.1.201608190732\r\nTi SDK 5.5.0.v20160831100821\r\nAppc NPM 4.2.7\r\nAppc CLI 5.5.0-5\r\nAlloy 1.9.1\r\nXcode 8.0 (8S201h)\r\n\r\nThe app no longer crashes and the specified data is removed, or all data is removed if no type is provided. Tested using the provided example as well as my own test app utilizing {{clearData()}}.", "updateAuthor": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-08-31T22:33:51.000+0000", "updated": "2016-08-31T22:33:51.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }