Tableview with searchbar not working.

You must Login before you can answer or comment on any questions.

My searchbar isn't working. It's obvious that my config object for the table view that's using it is incorrect. Here is the error I'm getting:

*** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[NSCFArray objectAtIndex:]: index (4) beyond bounds (4)'
Here is the gist for the code I'm working on.

3 Answers

2010-03-23: UPDATE - this appears resolved in Mobile SDK 1.1

I am experiencing this as well. It seems to occur as soon as I type anything into the searchbar.

The following, very simple code fails. This is all I have put in a window after creating a new project and redirecting the default win1 to url:win1.js.

w = Titanium.UI.currentWindow;
 
 
td = [
    {title: 'one-one', header: 'ONE'},
    {title: 'one-two'},
    {title: 'one-three'},
    {title: 'one-four'},
    {title: 'one-five'},
    {title: 'two-one', header: 'TWO'},
    {title: 'two-two'},
    {title: 'two-three'},
    {title: 'two-four'},
    {title: 'two-five'},
    {title: 'three-one', header: 'THREE'},
    {title: 'three-two'},
    {title: 'three-three'},
    {title: 'three-four'},
    {title: 'three-five'},
    {title: 'four-one', header: 'FOUR'},
    {title: 'four-two'},
    {title: 'four-three'},
    {title: 'four-four'},
    {title: 'four-five'},
    {title: 'five-one', header: 'FIVE'},
    {title: 'five-two'},
    {title: 'five-three'},
    {title: 'five-four'},
    {title: 'five-five'}
];
 
s = Titanium.UI.createSearchBar({});
 
t = Titanium.UI.createTableView({
    data: td,
    search: s,
    filterAttribute: 'title'
});
 
w.add(t);

We're trying to reproduce this locally in the debugger and see what's going on. Looks to be a bug and if so, we'll have a fix soon.

i had this error, when using different layouts (different type/amount of elements) on tableviewrows, but setting all tableviewRows className-properties to the same value

Your Answer

Think you can help? Login to answer this question!