Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-6368] iOS: Setting headers outside of table view row creation crashes the app

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-01-26T17:59:02.000+0000
Affected Version/sRelease 1.7.5, Release 1.8.0, Release 1.8.0.1
Fix Version/sRelease 1.7.6, Release 1.8.0.1, Sprint 2012-02, Release 2.0.0, Release 1.8.1
ComponentsiOS
Labelsmodule_tableviewrow, qe-ios012312, qe-testadded, regression
ReporterQing Gao
AssigneeVishal Duggal
Created2011-11-29T17:31:04.000+0000
Updated2013-12-10T05:53:26.000+0000

Description

If we are trying to add a large number of rows into a tableview and set the header for each row, that will crash the app.

Repro Steps

Step 1. Create an application based on the following code. Step 2. Run the app and a crash will be happened. Step 2. If you comment out the line "row.header='A'", the app won't crash.
// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#000');

//
// create base UI tab and root window
//
var win = Titanium.UI.createWindow({  
    backgroundColor:'#fff'
});

var table = Titanium.UI.createTableView({});
win.add(table);
win.open();

var addrow = function(){
	
		var row = Ti.UI.createTableViewRow({
			height:65
		});
		
		var photo = Ti.UI.createImageView({
	        // image: ,
	        top: 12,
	        left: 9,
	        width: 40,
	        height: 40,
	        clickName: 'photo'
	      });
	      
	      row.add(photo);
	      
	      var photo2 = Ti.UI.createImageView({
	        // image: ,
	        top: 12,
	        left: 9,
	        width: 40,
	        height: 40,
	        clickName: 'photo2'
	      });
	      
	      row.add(photo2);
	      
	      
		row.header='A';
		table.appendRow(row);

}
for(var i = 0; i<3000; i++){
	addrow();
	Ti.API.info(Ti.Platform.availableMemory);
}

Associated Helpdesk Tickdet:

http://support-admin.appcelerator.com/display/APP-654533

Attachments

FileDateSize
app.js2011-12-01T10:05:48.000+00004892
ios sim 5 log.txt2012-01-26T16:40:46.000+00004129
rowheadercrash_2011-11-29-171307_qgaombp.crash2011-11-29T17:46:28.000+000039189

Comments

  1. Vishal Duggal 2011-11-30

    Pull pending #798
  2. Vishal Duggal 2011-12-01

    Use this file to reproduce the crash
  3. Stephen Tramer 2011-12-01

    Will resolved-fixed once there is a fix in 1.7.6.
  4. Vishal Duggal 2011-12-01

    Pull 802 up for the 1_7_X branch
  5. Wilson Luu 2011-12-06

    Closing bug. Verified fix on: SDK build: 1.8.0.1.v20111205164258 OS: Mac OS X Lion Devices: ipod 4.0.2, iphone 5.0.1, ipad2 4.3.5. iOS Simulator (4.3)
  6. Dustin Hyde 2012-01-05

    Added label qe-testadded.
  7. Dustin Hyde 2012-01-26

    Reopening as Valid. Regression. SDK: 1.8.1.v20120125154634 Studio: 1.0.8.201201210622 OS: Lion Devices Tested: iPhone Simulator 5.0 Log Attached.
  8. Natalie Huynh 2012-01-27

    Tested with 1.8.1.v20120126191634 on iphone simulator 5.0 and iphone 4s 5.0.1
  9. Shameer Jan 2013-12-10

    Anvil testcase PR https://github.com/appcelerator/titanium_mobile/pull/4940

JSON Source