I am seeing a weird behavior and I have hard time tracking down what's
going on. Any suggestion on how to pinpoint the problem would be great. I
am running out of ideas.

I have UITableView where I dequeue the cells.

    MyCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MyCell"];

I then setup the cell

    cell.myLabel.text = @"test";
    cell.myLabel.textColor = [UIColor blackColor];

and resize the label to use the proper space for the content

    [cell.myLabel sizeToFit];

Unfortunately `sizeToFit` seems to work only for the re-used cells. So when
I scroll them off screen, the cells coming back on screen are looking fine.
The initial cells don't - they have the labels at their initial size given
in interface builder.

I tried by setting "numberOfLines" or setting a larger frame to shrink from
but I cannot seem to get this to work. It's almost like the first
"sizeToFit" call gets ignored.

Any idea what could be going on?

cheers,
Torsten
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to