views:

39

answers:

1

Hello,

I have a strange problem. I have a tableview with two sections. I am customizing them and on last row I have a button. When pressed, it reads the information from rows with the function cellForRowAtIndexPath.

This worked well until I changed the last row's height :

-(CGFloat) tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    if ([indexPath row] == [last count]-1)
        return 200.0;
    return 44.0;
}

When calling cellForRowAtIndexPath for the first two rows I am getting a nil, the rest are retuning well.

When I comment the function heightForRowAtIndexPath, it works well.

Any Idea?

A: 

You should add more code in your post in order we understand how you add button to your cell, and what are you doing in the function that handle click on your button.

(Sorry if I say that in an answer, I need more reputation to comment questions)

Ermiar