TableView crashes on focus in text field in header or footer view with empty table
I have table view headers and footers with text fields.
If the table view is empty, the app crashes when the text field gets focus.
The following error sometimes appears in the developer log:
[ERROR] Value was not the value expected. in -[TiUITableView keyboardDidShowAtHeight:forView:] (TiUITableView.m:1745)
I'm going to try working around this by adding a dummy row when the table would otherwise be empty.
This is in the iphone emulator with the 4.1 iphone sdk and the 1.4.2
Titanium sdk.
Here's a sample app that demonstrates this:
var title_view = Ti.UI.createView({height: '30'});
title_view.add(
Ti.UI.createTextField(
{ height:20, borderStyle:Ti.UI.INPUT_BORDERSTYLE_BEZEL}));
var items_view = Ti.UI.createTableView(
{top: 0, data: [], footerView: title_view});
var win = Ti.UI.createWindow({title: 'Win2'});
win.add(items_view);
win.open();
When the window opens, click in the text field. It doesn't crash
every time. I may have to re-launch the app a few times to see the
crash.
3 Answers
-
Jim
I'm afraid without some code I doubt there is much anyone can add to this.
The best way for you to obtain a resolution is by creating the simplest code (remove any superflous properties and functionality), that runs without modification when someone pastes it into an empty app.js script. If you provide this, someone will assist you.
-
I have the exactly same problem. Any fixes out there yet?
-
I can confirm this problem. Currently the only way around it is to make sure the tableview is never empty. I set data = [{title:''}] anytime the table needs to be empty and make sure to blur the keyboard before replacing the data array. A fix would re really nice!