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
Deleting the last row of a tableview crashes the app completely and very hard
Testcase:
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();
Error on deleting the last row
[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 <redacted> + 126
[ERROR] : 1 libobjc.A.dylib 0x34b78c8b objc_exception_throw + 38
[ERROR] : 2 CoreFoundation 0x272759e1 <redacted> + 0
[ERROR] : 3 TestApp 0x000ec063 TestApp + 53347
[ERROR] : 4 TestApp 0x0016d001 TestApp + 581633
[ERROR] : 5 TestApp 0x001786a3 TestApp + 628387
[ERROR] : 6 UIKit 0x2a913243 <redacted> + 358
[ERROR] : 7 UIKit 0x2aa11715 <redacted> + 268
[ERROR] : 8 UIKit 0x2a9ee685 <redacted> + 8348
[ERROR] : 9 TestApp 0x00176fa3 TestApp + 622499
[ERROR] : 10 UIKit 0x2aa06413 <redacted> + 142
[ERROR] : 11 UIKit 0x2aadfee5 <redacted> + 68
[ERROR] : 12 UIKit 0x2a8549fb <redacted> + 70
[ERROR] : 13 UIKit 0x2a8549a1 <redacted> + 44
[ERROR] : 14 UIKit 0x2a83f613 <redacted> + 582
[ERROR] : 15 UIKit 0x2a85440d <redacted> + 588
[ERROR] : 16 UIKit 0x2a8540e7 <redacted> + 522
[ERROR] : 17 UIKit 0x2a84d9b1 <redacted> + 544
[ERROR] : 18 UIKit 0x2a82415d <redacted> + 196
[ERROR] : 19 UIKit 0x2aa97ab9 <redacted> + 13888
[ERROR] : 20 UIKit 0x2a822bb9 <redacted> + 1296
[ERROR] : 21 CoreFoundation 0x27327d57 <redacted> + 14
[ERROR] : 22 CoreFoundation 0x27327167 <redacted> + 218
[ERROR] : 23 CoreFoundation 0x273257cd <redacted> + 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 <redacted> + 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)
PRs master: https://github.com/appcelerator/titanium_mobile/pull/6558 3_5_X: https://github.com/appcelerator/titanium_mobile/pull/6559
Closing ticket as fixed. App does not crash if you delete the last row in the table. Tested on: Appcelerator Studio, build: 3.4.1.201410281743 SDK build: 3.5.0.v20150109131718 CLI: 3.4.1 Alloy: 1.5.1 Xcode: 6.2 beta 3 Devices: iphone 6 (8.1)
SDK build should be 3.5.0.v20150109131718
Reopening ticket to fix my comment. Used copy and paste from an old note.