Description
If you add a searchBar to a tableView and set searchHidden:true on the tableView, you can not properly setData to the table.
iOS Error Message
2013-03-25 16:07:12.269 testApp[58263:1be03] *** Assertion failure in -[UITableView _endCellAnimationsWithContext:], /SourceCache/UIKit_Sim/UIKit-2380.17/UITableView.m:909
Simple Sample App
var win = Ti.UI.createWindow();
var searchBar = Ti.UI.createSearchBar();
var table = Ti.UI.createTableView({
search:searchBar,
searchHidden:true
});
win.add(table);
populateTable(5);
setInterval(function(){
var num = Math.floor(Math.random()*8);
populateTable(num);
}, 5000);
function populateTable(len){
var rows = [];
for(var i = 0; i<len; i++){
var row = Ti.UI.createTableViewRow({title:"Row "+i});
rows.push(row);
}
Ti.API.info("Set Data...");
table.setData(rows);
}
Closing ticket as duplicate.