我第二次......但這裏有這麼多優秀的開發者...的UITableView - > numberOfRowsInSection:(NSInteger的)板塊今日返回錯誤值
嗨,
我有一些麻煩與我的tableView ......如果認爲會出現我的表重新載入它的數據,但它不更新numbersOfRowsInSection ...
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
NSLog(@"COUNTER: %i",[content count]);
return [content count];
}
日誌說,我第一次加載頁面的權值。但是,如果我添加一個對象並重新加載數據,則此函數不會調用。
有沒有人知道解決方案?
謝謝, mavrick3。
編輯:
繼承人如何我打電話[table reloadData]
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
if ([content count] != 0) {
self.content = [[[[NSArray alloc] initWithContentsOfFile:[FileManager filePath]] objectAtIndex:row_] objectForKey:@"faecher"];
[table reloadData];
NSLog(@"----%@",content);
}
}
是的,數據源和委託連接,它們在我的頭都實現。
你在調用[myTableView reload]; ? – jakev 2011-02-15 17:52:21
顯示其餘代碼,以及如何/何時使用`reloadData`。 – WrightsCS 2011-02-15 17:52:23
剛剛使用代碼等進行編輯 – 2011-02-15 18:04:06