我想以编程方式在我的UITableView中设置文本。我不想从在tableView中设置文本
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
做到这一点我想是这样
[self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:1 inSection:0]].textField.text = @"test";
这不起作用,因为这不是结构的一部分。我该怎么做?一直在寻找文档,但无法找到它。
为什么你不想在cellForRowAtIndexPath方法中做到这一点? – Anna 2010-10-22 02:45:17
我想加载我的tableView与来自ABPeoplePickerNavigationControllerDelegate的数据。所以我认为从ABPeoplePickerNavigationControllerDelegate设置我的tableView.textField.text很容易。 – munchine 2010-10-22 02:56:49
现在无法给出详细的答案,但是您应该将从ABPeoplePicker获取的数据放入某个对象X并在cellForRowAtIndexPath中读取该对象。在ABPeoplePicker完成后,您可以在表视图上调用reloadData以使其显示更新的数据。 – Anna 2010-10-22 03:05:43