UITableView
とを使用するアプリを作成していますUITableViewController
。ただし、 を呼び出す[self.tableView reloadData];
とUITableViewController
、何も起こりtableView: cellForRowAtIndexPath:
ません ( は呼び出されません)。私は何をすべきか?
- (void) UserChangedAmmountAndCurrency: (NSNotification*) notification {
self.localBank.activeAmmount=((NSNumber*)[notification.userInfo objectForKey:@"newAmmount"]).doubleValue;
self.localBank.activeCurrency=[self.localBank.worldBank requestCurrencyForLocalBank:((NSString*)[notification.userInfo objectForKey:@"newISO4217Currency"])];
[self.tableView reloadData];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
NSNumber *ammount= [self.localBank ammountForElementAtIndex:indexPath.row];
VIPCurrency* currency=[self.localBank currencyForElementAtIndex:indexPath.row];
static NSString *CellIdentifier = @"cellWithCurrencyAndAmmount";
VIPConversionCell* cell=[self.tableView dequeueReusableCellWithIdentifier:CellIdentifier];
cell.longCurencyIdentifier.text=currency.longName;
cell.shortCurrencyIdentifier.text=currency.shortName;
cell.textfieldForAmmount.text=ammount.stringValue;
return cell;
}
編集:私はいくつかの追加のテストを行いました。tableview データソースとデリゲートが、reload メソッドを呼び出すために使用するビュー コントローラーであることをテストしましたが、これは問題ありませんでした。また、他にも奇妙なことに気付きました。reloadData を呼び出すとき、どちらnumberOfSectionsInTableView:
もnumberOfRowsInSection:
呼び出されません。reloadData を呼び出す前に基本的なことをしていないように感じますが、何がわかりません。どういうわけか、セルを期限切れとして具体的に設定する必要があるのでしょうか?
編集:メソッドがメインスレッドで呼び出されたことも確認しましたが、これも問題ありませんでした