0
基本上,我將項目添加到新視圖中的表格,如果用戶點擊保存,我希望視圖彈出,以及更新前的表格視圖以顯示新的添加。關於如何完成這項任務的任何想法?當用戶點擊導航視圖中的「保存」按鈕時,我希望重新加載表格視圖
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"PersonTableViewCell"];
if(!cell){
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"PersonTableViewCell"]autorelease];
}
p = [friendsArray objectAtIndex:[indexPath row]];
[[cell textLabel] setText:[p description]];
return cell;
}
問題是,當我這樣做時,它說我已將消息發送到解除分配的實例,我不知道如何解決該問題。 – Jerome 2012-04-10 16:38:40
上一個表視圖控制器不應該被釋放。導航控制器也不應該。如果他們這樣做了,那麼你在代碼的其他部分沒有正確管理它們。 – 2012-04-10 16:41:59
我確定它不是表視圖控制器,而是一個導致錯誤的對象'p': – Jerome 2012-04-10 16:49:56