在我的tableview中调用方法中的行no的方法被调用,它返回值17,但cellforrowatindexpath没有被调用。我已经把断点放在第一行这个方法,但这一点从来没有显示调试时,我已经遵循tableviewdelegate和datasource.and tableviews数据源,委托在Int构建器中正确设置。uitableview cellforrowatindexpath没有调用,但没有:行中的行被称为
我也张贴一些代码
在我viewcontroller.m
-(void)viewDidLoad
{
tweets=[[NSMutableArray alloc]init];
[self updateStream:nil];
[self.tweetsTable setDelegate:self];
[self.tweetsTable setDataSource:self];
}
-(NSInteger)tableView:(UITableView *)tweetsTable numberOfRowsInSection:(NSInteger)section {
return [tweets count];
}
-(UITableViewCell *)tableView:(UITableView *)tweetsTable cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"twitCell";
TwitCell *cell = (TwitCell *)[tweetsTable dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = (TwitCell *)[[[TwitCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
cell.tweet = [tweets objectAtIndex:indexPath.row];
[cell layoutSubviews];
return cell;
}
其返回17。我发现,调试 – sujith1406 2011-05-18 11:12:08