私はこれが何度も何度も尋ねられたことを知っています。与えられたすべての解決策を試しましたが、それでもうまくいきませんでした。データソースとデリゲートをテーブル ビューに設定し、ポインタにも設定しました。
これが私のコードです:
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
NSLog(@"%i", resultSoap.count);
return resultSoap.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
// Configure the cell.
NSString *cellValue = [resultSoap objectAtIndex:indexPath.row];
cell.textLabel.text = cellValue;
NSLog(@"Celldisplay");
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
return cell;
}
メソッドでを呼び出しましreloadData
たviewDidLoad:
。問題は、メソッドを起動し、行数を正しく取得しましたが、このメソッドを起動numberOfRowsInSection:
しませんでしたcellForRowAtIndexPath:
。
解決策はありますか?