Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Tableview with searchbar not working.

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.

— asked March 9th 2010 by Caige Nichols
  • 1.0
  • searchbar
  • tableview

3 Answers

  • 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

    — answered March 10th 2010 by Christian Sigl
  • 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'
    — answered March 22nd 2010 by Phillip Thomas
  • 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.

    — answered March 9th 2010 by Jeff Haynie
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.