I don't see an example of how you are creating cells in your first post. But
in case you were using the same string for the reuse identifier then when
the cell is loaded the second time it will not switch to a different style.
Because whatever cell was cashed the first time it will be reused. That's
the point. You should create two different reuse identifiers for two
different types of cells. Then in your "if" blocks you should check if the
cell is already cached for that reuse identifier, if it isn't create a new
one. It seems that you were creating a cell outside of the "if" blocks using
one identifier.

Peace,
Karolis

On Sat, Nov 21, 2009 at 3:55 AM, Tharindu Madushanka
<tharindu...@gmail.com>wrote:

> Hi
>
> Removing reuse identifier solved the problem so now I am creating a cell
> like below. It worked.
>
> UITableViewCellStyle style;
> if(profile.name.length > 0) {
>    style = UITableViewCellStyleSubview;
> } else {
>    style = UITableViewCellStyleDefault;
> }
>
> UITableViewCell *cell = [[[UITableViewCell alloc] initWithStyle:style
> reuseIdentifier:nil]autorelease];
>
> No reuse identifiers or dequeue method in table view is not used while
> creating cells
>
> Since its only once cell, doing this is ok ? is it ?
>
> -Tharindu
> _______________________________________________
>
> 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:
> http://lists.apple.com/mailman/options/cocoa-dev/karolisr%40gmail.com
>
> This email sent to karol...@gmail.com
>
_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Reply via email to