Project: titanium
Issue TIMOB-18332: iOS: App crashes on deleting last row of tableview
{code:xml} Operating System Name = Mac OS X Version = 10.10.2 Architecture = 64bit # CPUs = 8 Memory = 17179869184 Node.js Node.js Version = 0.10.26 npm Version = 2.0.2 Titanium CLI CLI Version = 3.4.1 Titanium SDK SDK Version = 3.5.0.RC SDK Path = /Volumes/Data/Users/sebastian/Library/Application Support/Titanium/mobilesdk/osx/3.5.0.RC Target Platform = iphone {code} Deleting the last row of a tableview crashes the app completely and very hard Testcase: {code:javascript} var win = Ti.UI.createWindow(); var data = []; for (var i = 0; i < 10; i++) { data.push(Ti.UI.createTableViewRow({ title: 'row ' + i })); } var tableView = Ti.UI.createTableView({ editable: true, data: data }); win.add(tableView); win.open(); {code} Error on deleting the last row {code:xml} [ERROR] : The application has crashed with an uncaught exception 'NSRangeException'. [ERROR] : Reason: [ERROR] : *** -[__NSArrayM objectAtIndex:]: index 19 beyond bounds [0 .. 18] [ERROR] : Stack trace: [ERROR] : [ERROR] : 0 CoreFoundation 0x2736149f + 126 [ERROR] : 1 libobjc.A.dylib 0x34b78c8b objc_exception_throw + 38 [ERROR] : 2 CoreFoundation 0x272759e1 + 0 [ERROR] : 3 TestApp	0x000ec063 TestApp + 53347 [ERROR] : 4 TestApp	0x0016d001 TestApp + 581633 [ERROR] : 5 TestApp	0x001786a3 TestApp + 628387 [ERROR] : 6 UIKit 0x2a913243 + 358 [ERROR] : 7 UIKit 0x2aa11715 + 268 [ERROR] : 8 UIKit 0x2a9ee685 + 8348 [ERROR] : 9 TestApp	0x00176fa3 TestApp + 622499 [ERROR] : 10 UIKit 0x2aa06413 + 142 [ERROR] : 11 UIKit 0x2aadfee5 + 68 [ERROR] : 12 UIKit 0x2a8549fb + 70 [ERROR] : 13 UIKit 0x2a8549a1 + 44 [ERROR] : 14 UIKit 0x2a83f613 + 582 [ERROR] : 15 UIKit 0x2a85440d + 588 [ERROR] : 16 UIKit 0x2a8540e7 + 522 [ERROR] : 17 UIKit 0x2a84d9b1 + 544 [ERROR] : 18 UIKit 0x2a82415d + 196 [ERROR] : 19 UIKit 0x2aa97ab9 + 13888 [ERROR] : 20 UIKit 0x2a822bb9 + 1296 [ERROR] : 21 CoreFoundation 0x27327d57 + 14 [ERROR] : 22 CoreFoundation 0x27327167 + 218 [ERROR] : 23 CoreFoundation 0x273257cd + 772 [ERROR] : 24 CoreFoundation 0x272733c1 CFRunLoopRunSpecific + 476 [ERROR] : 25 CoreFoundation 0x272731d3 CFRunLoopRunInMode + 106 [ERROR] : 26 GraphicsServices 0x2e62b0a9 GSEventRunModal + 136 [ERROR] : 27 UIKit 0x2a882fa1 UIApplicationMain + 1440 [ERROR] : 28 TestApp	0x000e7f1b TestApp + 36635 [ERROR] : 29 libdyld.dylib 0x350f8aaf + 2 [ERROR] : *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 19 beyond bounds [0 .. 18]' [ERROR] : *** First throw call stack: [ERROR] : (0x2736149f 0x34b78c8b 0x272759e1 0xec063 0x16d001 0x1786a3 0x2a913243 0x2aa11715 0x2a9ee685 0x176fa3 0x2aa06413 0x2aadfee5 0x2a8549fb 0x2a8549a1 0x2a83f613 0x2a85440d 0x2a8540e7 0x2a84d9b1 0x2a82415d 0x2aa97ab9 0x2a822bb9 0x27327d57 0x27327167 0x273257cd 0x272733c1 0x272731d3 0x2e62b0a9 0x2a882fa1 0xe7f1b 0x350f8aaf) {code}
Story points: 5