[TIMOB-17001] iOS: Search disappears from ListView
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | High |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2014-11-04T22:36:24.000+0000 |
| Affected Version/s | Release 3.2.3 |
| Fix Version/s | Release 3.4.0 |
| Components | iOS |
| Labels | defect, ios, iphone |
| Reporter | Thomas Wilkinson |
| Assignee | Jon Alter |
| Created | 2014-05-20T20:59:22.000+0000 |
| Updated | 2017-03-23T22:26:42.000+0000 |
Description
ListView with a search, where the itemclick event opens a window.
This defect works in the ElementsOfListView tutorial app ( https://github.com/appcelerator-services/ElementsOfListView ). The customer is having the same issue in their own app.
1) Wait for the elements list to open
2) Scroll down a bit, half a screen or more.
3) Click on an element (the name, not the symbol) and wait for the new window to open.
4) Close that new window by clicking the "Done" button.
5) Scroll back up to the top. Notice there is a white space where the Search was.
At this point, it should be noted that the search is still there, it just appears blank. If you click into it, it'll appear as it should.
Edit:
Simpler test case, copy and paste into app.js
function MainWindow() {
var win = Ti.UI.createWindow({
backgroundColor: 'white'
});
var items = [];
for(var i = 0; i < 100; i++) {
items.push({
properties:{
title: 'Row #' + (i + 1),
searchableText: 'Row #' + (i + 1)
}
});
}
var listViewSection = Ti.UI.createListSection({
items: items
});
var searchBar = Ti.UI.createSearchBar();
var listView = Ti.UI.createListView({
sections: [listViewSection],
searchView: searchBar
});
win.add(listView);
listView.addEventListener('itemclick', function(){
SecondWindow().open({modal:true});
});
return win;
}
function SecondWindow() {
var navWindow = Ti.UI.iOS.createNavigationWindow();
var win = Ti.UI.createWindow({
backgroundColor: 'gray'
});
var closeBtn = Ti.UI.createButton({
title: 'close'
});
win.rightNavButton = closeBtn;
navWindow.window = win;
closeBtn.addEventListener('click', function(){
navWindow.close();
});
return navWindow;
}
MainWindow().open();
I'm going to bump up the priority because there is no workaround on it.
Tested on: Mac OSX 10.9.3 Appcelerator Studio, build: 3.3.0.201406061445 Titanium SDK, build: 3.3.0.v20140606154912, 3.2.3.GA, 3.2.0.GA Titanium CLI, build: 3.3.0-beta3 Alloy: 1.4.0-beta2 iPhone 5S (7.0.6) Reproduced this issue using the latest master SDK, latest stable SDK and 3.2.0.GA SDK. Scrolled down half a screen or more. Opened a new window, closed the new window and tapped the status bar to jump to the top of the listView. Search bar is no longer present. Opening a new window and closing it again will bring back the search bar.
Pull pending against master https://github.com/appcelerator/titanium_mobile/pull/5938
I just tested this with continuous build 3.4.0.v20140813022514 and if you search and tap a search result the app crashes. Also crashes if you have a search keyword entered and tap the X in the search field to clear. [ERROR] : The application has crashed with an uncaught exception 'UIViewControllerHierarchyInconsistency'. [ERROR] : Reason: [ERROR] : A view can only be associated with at most one view controller at a time! View
Reopening the issue since the app crashes with given above code while searching and tapping search result. Verified with: Appcelerator Studio:3.4.0.201408180158 Sdk:3.4.0.v20140815142514 alloy:1.5.0-dev titanium:3.4.0-dev titanium-code-processor:1.1.1 acs:1.0.16 npm:1.3.2 OS:Maverick(10.9.4) xcode: Xcode6Beta5 Device:iPhone5c(v7.1.1)
[ERROR] : The application has crashed with an uncaught exception 'UIViewControllerHierarchyInconsistency'. [ERROR] : Reason: [ERROR] : A view can only be associated with at most one view controller at a time! View <UITableView: 0x163bce00; frame = (0 0; 320 568); clipsToBounds = YES; autoresize = W+H; gestureRecognizers = <NSArray: 0x15626620>; layer = <CALayer: 0x15626a90>; contentOffset: {0, 0}> is associated with <UITableViewController: 0x15750e00>. Clear this association before associating this view with <UITableViewController: 0x1574fd30>. [ERROR] : Stack trace: [ERROR] : [ERROR] : 0 CoreFoundation 0x2e3a2ecb <redacted> + 130 [ERROR] : 1 libobjc.A.dylib 0x38b3dce7 objc_exception_throw + 38 [ERROR] : 2 CoreFoundation 0x2e3a2e0d <redacted> + 0 [ERROR] : 3 UIKit 0x30c4b259 <redacted> + 232 [ERROR] : 4 UIKit 0x30c4af15 <redacted> + 464 [ERROR] : 5 UIKit 0x30df77cd <redacted> + 204 [ERROR] : 6 testApp 0x0020c25d testApp + 1438301 [ERROR] : 7 testApp 0x0020ab0f testApp + 1432335 [ERROR] : 8 testApp 0x0012031f testApp + 471839 [ERROR] : 9 UIKit 0x30dc4113 <redacted> + 70 [ERROR] : 10 UIKit 0x30cd0449 <redacted> + 188 [ERROR] : 11 UIKit 0x30c52a69 <redacted> + 20 [ERROR] : 12 UIKit 0x30c52783 <redacted> + 206 [ERROR] : 13 UIKit 0x30c52adf <redacted> + 106 [ERROR] : 14 UIKit 0x30ccf44b <redacted> + 46 [ERROR] : 15 UIKit 0x30e0b307 <redacted> + 490 [ERROR] : 16 UIKit 0x30c096a7 <redacted> + 90 [ERROR] : 17 UIKit 0x30c09643 <redacted> + 38 [ERROR] : 18 UIKit 0x30c09613 <redacted> + 46 [ERROR] : 19 UIKit 0x30bf4d5b <redacted> + 374 [ERROR] : 20 UIKit 0x30c0905b <redacted> + 594 [ERROR] : 21 UIKit 0x30c08d2d <redacted> + 528 [ERROR] : 22 UIKit 0x30c03c87 <redacted> + 758 [ERROR] : 23 UIKit 0x30bd8e55 <redacted> + 196 [ERROR] : 24 testApp 0x0030aecd _ZN3WTI13tryMakeStringIPKcN2TI7UStringES2_EENS_10PassRefPtrINS_10StringImplEEET_T0_T1_ + 196916 [ERROR] : 25 UIKit 0x30bd7521 <redacted> + 7120 [ERROR] : 26 CoreFoundation 0x2e36dfaf <redacted> + 14 [ERROR] : 27 CoreFoundation 0x2e36d477 <redacted> + 206 [ERROR] : 28 CoreFoundation 0x2e36bc67 <redacted> + 630 [ERROR] : 29 CoreFoundation 0x2e2d6729 CFRunLoopRunSpecific + 524 [ERROR] : 30 CoreFoundation 0x2e2d650b CFRunLoopRunInMode + 106 [ERROR] : 31 GraphicsServices 0x332456d3 GSEventRunModal + 138 [ERROR] : 32 UIKit 0x30c37871 UIApplicationMain + 1136 [ERROR] : 33 testApp 0x000b273f testApp + 22335 [ERROR] : 34 libdyld.dylib 0x3903bab7 <redacted> + 2 -- End application log -------------------------------------------------------Confirmed above crash PR: https://github.com/appcelerator/titanium_mobile/pull/5996
Look like that crash is the same I reported TC-4611
Closing ticket as fixed. Verified the search field does not disappear in ListView after scrolling pass halfway. Tested on: Appcelerator Studio, build: 3.4.0.201408291834 SDK build: 3.4.0.v20140829184521 CLI: 3.4.0-dev Alloy: 1.5.0-dev Xcode: 6-beta6 Devices: iphone 5 (7.0.6)
This ticket should be reopened since the above PR is fixing a crash in the example, not the actual reported issue. This issue still persists in 3.4.0.GA even without first having to open a window over it. I'm trying to come up with a good test case, but reproducing is hard since it happens about 1 out of 10 times in an enterprise app I'm doing which involves a lots of interconnected code around the list view.
O wait, I see there's another PR. Well, anyway... problem still exists in 3.4.0.GA for me.
[~fokke] We evidently need a test case to reproduce before we can reopen. Please see if you can arrive at one (I know it is complicated).
I haven't seen it anymore since iOS 8.1 so I think it was an 8.0 bug, since it was popping up there daily.
Still seen it in 8.1.1
Hello [~jalter]:
Testing Environments
iphone 6 - iOS 8.1.2 - Mobile SDK 3.4.1 - OK ipod touch - iOS 8.1.1 - Mobile SDK 3.4.1 - OK iphone 6+ sim - iOS 8.1 - Mobile SDK 3.4.1 - OK.Instructions to reproduce
1. Create new mobile project 2. Add the sample code in the issue to app.js 3. Run it in device 4. Scroll to row 30+ 5. Click in a row 6. Click Done 7. Scroll to the top and check the searchActual results
The search is still there and says search in all the described test in different environments.Closing as fixed.