Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-3410] simple table view search crashes on 1.7.0

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2011-05-16T11:00:03.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.7.0, Sprint 2011-13
ComponentsiOS
Labelsios, release-1.7.0, tableview
ReporterLeo Lou
AssigneeReggie Seagraves
Created2011-04-15T03:43:57.000+0000
Updated2011-05-16T11:00:03.000+0000

Description


var win = Titanium.UI.currentWindow;
var search = Titanium.UI.createSearchBar({
    showCancel:true,
    height:43,
    top:0
});
var data = [];
 
data[0] = Titanium.UI.createTableViewSection({headerTitle:'Header 1'});
data[0].add(Titanium.UI.createTableViewRow({title:'Row 1'}));
 
data[1] = Titanium.UI.createTableViewSection({headerTitle:'Header 2'});
data[1].add(Titanium.UI.createTableViewRow({title:'Row 2'}));

search.addEventListener('focus', function(e)
{
    Ti.API.info('focus');
});

var tableview = Titanium.UI.createTableView({
  data:data,
  search:search,
 
});

tableview.addEventListener('click',function(e) {
  Ti.API.info(e);
});

win.add(tableview);

crashes on 1.7.0 (with iOS 4.1)
works on 1.6.2

steps to reproduce:
1) type r in search box
2) click row 1

error:
Invalid update: invalid number of sections. The number of sections contained in the table view after the update (2) must be equal to the number of sections contained in the table view before the update (1)

Comments

  1. Leo Lou 2011-04-15

    Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid update: invalid number of sections. The number of sections contained in the table view after the update (18) must be equal to the number of sections contained in the table view before the update (1), plus or minus the number of sections inserted or deleted (0 inserted, 0 deleted).' Call stack at first throw: ( 0 CoreFoundation 0x0388ab99 exceptionPreprocess + 185
    1 libobjc.A.dylib 0x039da40e objc_exception_throw + 47
    2 CoreFoundation 0x03843238 +[NSException raise:format:arguments:] + 136
    3 Foundation 0x006ade37 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 116
    4 UIKit 0x0092d9a6 -[UITableView(UITableViewPrivate) endCellAnimationsWithContext:] + 7806
    5 UIKit 0x0091d4d3 -[UITableView reloadRowsAtIndexPaths:withRowAnimation:] + 56
    6 UIKit 0x08b0d898 -[UITableViewAccessibility(Accessibility) reloadRowsAtIndexPaths:withRowAnimation:] + 74
    7 MyApp 0x00074648 -[TiUITableView hideSearchScreen:] + 604
    8 MyApp 0x000731be -[TiUITableView triggerActionForIndexPath:fromPath:tableView:wasAccessory:search:name:] + 1637
    9 MyApp 0x00079222 -[TiUITableView tableView:didSelectRowAtIndexPath:] + 205
    10 UIKit 0x00926a48 -[UITableView selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:] + 1140
    11 UIKit 0x0091d32e -[UITableView
    userSelectRowAtIndexPath:] + 219
    12 Foundation 0x0063221a
    NSFireDelayedPerform + 441
    13 CoreFoundation 0x0386bf73 CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION + 19
    14 CoreFoundation 0x0386d5b4 CFRunLoopDoTimer + 1364
    15 CoreFoundation 0x037c9dd9
    CFRunLoopRun + 1817
    16 CoreFoundation 0x037c9350 CFRunLoopRunSpecific + 208
    17 CoreFoundation 0x037c9271 CFRunLoopRunInMode + 97
    18 GraphicsServices 0x0547100c GSEventRunModal + 217
    19 GraphicsServices 0x054710d1 GSEventRun + 115
    20 UIKit 0x008c1af2 UIApplicationMain + 1160
    21 MyApp 0x0000388c main + 362
    22 MyApp 0x000026b1 start + 53
    ) terminate called after throwing an instance of 'NSException'

  2. Leo Lou 2011-04-15

    fixed in 1.7.0 Apr 1 r1203e55e

  3. Thomas Huelbert 2011-05-11

    thanks for confirming the fix Leo - also checked 3.1.3 iphone3, 4.3.3 ipad2 [INFO] Titanium SDK version: 1.7.0 (05/10/11 19:34 879871b...)

JSON Source