{ "id": "63923", "key": "TIMOB-3291", "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": "11244", "name": "Release 1.7.0", "archived": true, "released": true, "releaseDate": "2011-06-13" }, { "id": "12078", "description": "", "name": "Sprint 2011-38", "archived": true, "released": true, "releaseDate": "2011-09-26" }, { "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": "2011-11-05T15:39:54.000+0000", "created": "2011-04-15T03:41:29.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "branch-5062" ], "versions": [ { "id": "11244", "name": "Release 1.7.0", "archived": true, "released": true, "releaseDate": "2011-06-13" }, { "id": "11331", "description": "", "name": "Release 1.8.0", "archived": true, "released": true, "releaseDate": "2011-10-31" } ], "issuelinks": [ { "id": "12787", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "80509", "key": "TIMOB-5337", "fields": { "summary": "iOS: Popover Crash when Switching Tabs", "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": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2011-11-05T15:39:54.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\nIf you click a button to display a popover from a UI Tab Bar item, but navigate away from the tab's page before the popover has a chance to display, the app will crash with the following error:\r\n\r\n\"Popovers cannot be presented from a UIBarButtonItem that is not in a toolbar or navigation bar already.\"\r\n\r\nh2. Steps to Reproduce\r\nDrop the following in an app.js. It will open a window in the tab group, close the window, try to display a popover, and then crash. No intervention is required by you.\r\n{code:title=app.js}\r\nvar tab, win;\r\nvar tabs = Ti.UI.createTabGroup();\r\ntabs.addTab(tab = Ti.UI.createTab({\r\n window: win = Ti.UI.createWindow()\r\n}));\r\ntabs.open();\r\n\r\nwin.addEventListener('open', cycle);\r\n\r\nfunction cycle() {\r\n var action = Ti.UI.createButton({\r\n title: 'Show Popover'\r\n });\r\n action.addEventListener('click', function(e) {\r\n Ti.UI.iPad.createPopover({\r\n width: 250, height: 100,\r\n title: 'Test Popover Crash'\r\n }).show({ view: action });\r\n });\r\n\r\n var child = Ti.UI.createWindow({\r\n rightNavButton: action\r\n });\r\n child.addEventListener('close', function() {\r\n \tsetTimeout(cycle, 1000);\r\n });\r\n tab.open(child);\r\n\r\n setTimeout(function() {\r\n action.fireEvent('click');\r\n }, 1000);\r\n setTimeout(function() {\r\n child.close();\r\n child.rightNavButton = null;\r\n }, 500);\r\n}\r\n{code}\r\n\r\nh2. Error\r\n{code:title=Console Log}\r\n2011-09-22 08:34:30.394 play[6948:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Popovers cannot be presented from a UIBarButtonItem that is not in a toolbar or navigation bar already.'\r\n\r\n*** Call stack at first throw:\r\n(\r\n\t0 CoreFoundation 0x024cbbe9 __exceptionPreprocess + 185\r\n\t1 libobjc.A.dylib 0x026205c2 objc_exception_throw + 47\r\n\t2 CoreFoundation 0x02484628 +[NSException raise:format:arguments:] + 136\r\n\t3 CoreFoundation 0x0248459a +[NSException raise:format:] + 58\r\n\t4 UIKit 0x00c467df -[UIPopoverController presentPopoverFromBarButtonItem:permittedArrowDirections:animated:] + 194\r\n\t5 play 0x0018a7d7 -[TiUIiPadPopoverProxy updatePopoverNow] + 263\r\n\t6 play 0x0018a600 -[TiUIiPadPopoverProxy show:] + 1824\r\n\t7 Foundation 0x006829a6 __NSThreadPerformPerform + 251\r\n\t8 CoreFoundation 0x024ad01f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15\r\n\t9 CoreFoundation 0x0240b28b __CFRunLoopDoSources0 + 571\r\n\t10 CoreFoundation 0x0240a786 __CFRunLoopRun + 470\r\n\t11 CoreFoundation 0x0240a240 CFRunLoopRunSpecific + 208\r\n\t12 CoreFoundation 0x0240a161 CFRunLoopRunInMode + 97\r\n\t13 GraphicsServices 0x0408b268 GSEventRunModal + 217\r\n\t14 GraphicsServices 0x0408b32d GSEventRun + 115\r\n\t15 UIKit 0x0091242e UIApplicationMain + 1160\r\n\t16 play 0x0000396a main + 410\r\n\t17 play 0x00002235 start + 53\r\n\t18 ??? 0x00000001 0x0 + 1\r\n\r\n)\r\n\r\nterminate called after throwing an instance of 'NSException'\r\n\r\n[DEBUG] Session did end with error (null)\r\n{code}", "attachment": [ { "id": "23021", "filename": "timob3291.rtf", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-09-22T10:11:23.000+0000", "size": 3131, "mimeType": "text/rtf" } ], "flagged": false, "summary": "iOS: Popover Crash when Navigating Back in Tab Group", "creator": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "environment": null, "comment": { "comments": [ { "id": "130488", "author": { "name": "jhaynie", "key": "jhaynie", "displayName": "Jeff Haynie", "active": false, "timeZone": "America/Los_Angeles" }, "body": "{html}
(from [1df642e2a3852b1d2035743be51cbfb64e1331cd])\n[#3291 state:fixed-in-qa] Display a warning and\nshort-circuit popover display when the presenting view isn't in the\ncurrent window. \nhttps://github.com/appcelerator/titanium_mobile/commit/1df642e2a385...
Tested with Titanium SDK version: 1.7.0 (03/08/11 09:53 1df642e)\non
\niPad 3.2
\niPad 4.3
This still happens in some contexts.
Steps to reproduce: Add a popover to the rightNavButton ->\nClick to open -> click somewhere to close -> click to open,\netc.. If you do it fast enough on device it will crash with the\nfollowing stack trace: http://pastie.org/1704513
\nIt is important to note that it only happens if you are really\nfast or an app is doing some background processing so the popover\ndoesn't disappear right away. It's difficult to reproduce.