Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/41.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 添加到UITableView_Iphone_Uitableview - Fatal编程技术网

Iphone 添加到UITableView

Iphone 添加到UITableView,iphone,uitableview,Iphone,Uitableview,我正在开发iPhone应用程序,但我需要能够将内容添加到UITableView。。。 最简单的方法是什么 Techy如果您使用的UITableViewController由NSMutableArray(或NSArray)支持,那么您必须做的第一件事就是将新对象添加到数组中,如下所示: [objects addObject:obj]; 然后打电话 [tableView reload] 这将导致选中tableView:numberofrowsin节: - (NSInteger)tableView

我正在开发iPhone应用程序,但我需要能够将内容添加到UITableView。。。 最简单的方法是什么


Techy

如果您使用的UITableViewController由NSMutableArray(或NSArray)支持,那么您必须做的第一件事就是将新对象添加到数组中,如下所示:

[objects addObject:obj];
然后打电话

[tableView reload]
这将导致选中
tableView:numberofrowsin节:

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return [objects count]; 
} 
最后,将调用
tableView:cellforrowatinexpath:
,您可能已经编写了该函数来处理渲染单元格