开发者

Request for member 'row' in something not a structure or union

this is my first time here!

I'm getting that error when configuring an UITableViewCell.

This is my Cell:

@interface CellView : UITableViewCell {
    IBOutlet UILabel *nombre;
    IBOutlet UILabel *estado;
}

-(void)setName:(NSString *) name;

And this is the method that executes for every row:

    -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSInteger *)indexPath {
    static NSString *CellIdentifier = @"CellView";

    CellView *cell = (CellView *) [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if(cell==nil){
        NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"CellView" owner:nil options:nil];
        for(id currentObject in topLevelObjects){
            if([currentObject isKindOfClass:[UITableViewCell class]]){
                cell = (CellView *) currentObject;
                break;
            }
        }
    }
    [cell setName:[latitudes objectAtIndex:indexPath.row]];
    return cell;    
}

latitudes is a NSMutableArray

I've tried also with cell.nombre.text=[latitudes objetcAtIndex:indexP开发者_StackOverflow中文版ath.row]; but still returns the same error.

Any idea?

Thank you!


Your method signature seems to be wrong:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSInteger *)indexPath 

It should be (note the type of the indexPath parameter):

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜