Conditional adding an image to custom cell.contentView property - cocoa-touch

I want to create a UITableViewCell with an image between the content and the accessory view, sonly if certain condition is met.
So I have to create a custom content view with two UILabel and UIImageView as described in "Table View Programming Guide for iOS".
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = #"Cell";
UILabel *mainLabel;
UILabel *secondLabel;
UIImageView *icon;
YOEvento *aux = [[self.eventosListsContainer objectAtIndex:indexPath.section] objectAtIndex:indexPath.row];
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
// 1. Check if it is a favourtite to display the icon
if (aux.isFavourite) {
// Evento is favourite
// 1. Create the main label view
mainLabel = [[[UILabel alloc] initWithFrame:CGRectMake(20, 8, 248, 14)] autorelease];
mainLabel.tag = MAINLABEL_TAG;
mainLabel.font = [UIFont systemFontOfSize:13.0];
mainLabel.textColor = [UIColor darkGrayColor];
mainLabel.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleHeight;
[cell.contentView addSubview:mainLabel];
// Create the date label
secondLabel = [[[UILabel alloc] initWithFrame:CGRectMake(23, 24, 245, 11)] autorelease];
secondLabel.tag = SECONDLABEL_TAG;
secondLabel.font = [UIFont systemFontOfSize:11.0];
secondLabel.textColor = [UIColor lightGrayColor];
secondLabel.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleHeight;
[cell.contentView addSubview:secondLabel];
// Create the image
icon = [[[UIImageView alloc] initWithFrame:CGRectMake(268, 12, 24, 21)] autorelease];
icon.tag = ICON_TAG;
icon.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleHeight;
[cell.contentView addSubview:icon];
} else {
// Evento is not favourite
// 1. Create the main label view
mainLabel = [[[UILabel alloc] initWithFrame:CGRectMake(20, 8, 282, 14)] autorelease];
mainLabel.tag = MAINLABEL_TAG;
mainLabel.font = [UIFont systemFontOfSize:13.0];
mainLabel.textColor = [UIColor darkGrayColor];
mainLabel.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleHeight;
[cell.contentView addSubview:mainLabel];
// Create the date label
secondLabel = [[[UILabel alloc] initWithFrame:CGRectMake(23, 24, 279, 11)] autorelease];
secondLabel.tag = SECONDLABEL_TAG;
secondLabel.font = [UIFont systemFontOfSize:11.0];
secondLabel.textColor = [UIColor lightGrayColor];
secondLabel.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleHeight;
[cell.contentView addSubview:secondLabel];
}
} else {
//
if (aux.isFavourite) {
mainLabel = (UILabel *)[cell.contentView viewWithTag:MAINLABEL_TAG];
secondLabel = (UILabel *)[cell.contentView viewWithTag:SECONDLABEL_TAG];
icon = (UIImageView *)[cell.contentView viewWithTag:ICON_TAG];
} else {
mainLabel = (UILabel *)[cell.contentView viewWithTag:MAINLABEL_TAG];
secondLabel = (UILabel *)[cell.contentView viewWithTag:SECONDLABEL_TAG];
}
}
// Load cell values
if (aux.isFavourite) {
mainLabel.text = aux.nombre;
secondLabel.text = #"16 de Octubre"; // ?????????????
icon.image = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:#"29-heart"
ofType:#"png"]];
} else {
mainLabel.text = aux.nombre;
secondLabel.text = #"16 de Octubre"; // ?????????????
}
return cell;
}
The problem is that the icon image is loaded randomly because it keeps showing when reusing cells.
I have to admit that I don't fully understand the reusing cells theory.
In my original implementation (using the imageView property) it was easy, I just check is the event was not a favorite to set cell.imageView = nil. But have no idea how to do with custom contentView.

Once you create your cell, you are wanting to re-arrange its contents - this is adding unnecessary complexity. Instead you should create two different cell types - one for a favourite and one for a non-favourite. Try something like this:
static NSString *CellIdentifierFavourite = #"CellFavourite";
static NSString *CellIdentifierNonFavourite = #"CellNonFavourite";
// Other setup goes here
YOEvento *aux = [[self.eventosListsContainer objectAtIndex:indexPath.section] objectAtIndex:indexPath.row];
if (aux.isFavourite) {
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifierFavourite];
if (cell == nil) {
// Create favourite cell here
}
// Populate favourite cell here
} else {
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifierNonFavourite];
if (cell == nil) {
// Create non-favourite cell here
}
// Populate non-favourite cell here
}
// Rest of method goes below

Related

xCode: TableView cant see/acces all cells

When I press a button called "AllOK" I want the object.selectedIndex to be 0. This works perfectly with the cells that is visible. But it won't acces the cells which isn't viewable on the app / screen. If you scroll down and get vision of them, it will check them, but i want it to do it, without having to scroll down.
Do anyone know how to get the tableview to know that it "also" got the cells that it cannot see?
My code for my tableview and for the button:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:#"FancyCell"];
cell = nil;
if (!cell) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:#"FancyCell"];
cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;
// add the segmentedControl when you create a new cell
UIImage *correctImageGreen = [[UIImage imageNamed:#"green.png"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
UIImage *correctImageGul = [[UIImage imageNamed:#"gul.png"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
UIImage *correctImageRed = [[UIImage imageNamed:#"red.png"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
UIImage *correctImageGray = [[UIImage imageNamed:#"gray.png"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
NSArray *itemArray = [NSArray arrayWithObjects: correctImageGreen, correctImageGul, correctImageRed, correctImageGray, nil];
UISegmentedControl *segmentedControl = [[UISegmentedControl alloc] initWithItems:itemArray];
segmentedControl.frame = CGRectMake(310, 7, 150, 30);
[cell.contentView addSubview:segmentedControl];
// add an action so we can change our model if the view changes
[segmentedControl addTarget:self action:#selector(didChangeSegmentedControl:) forControlEvents:UIControlEventValueChanged];
// use a tag so we can retrieve the segmentedControl later
segmentedControl.tag = 42;
}
// either if the cell could be dequeued or you created a new cell,
// segmentedControl will contain a valid instance
UISegmentedControl *segmentedControl = (UISegmentedControl *)[cell.contentView viewWithTag:42];
UIImage *comment = [UIImage imageNamed:#"Checkmark-hvid"];
UIImage *imageRef = [UIImage imageNamed:#"Checkmark-hvid"];
UIImageView *commentView = [[UIImageView alloc] initWithImage: comment];
UIImageView *imageRefView = [[UIImageView alloc] initWithImage: imageRef];
commentView.frame = CGRectMake(625, 5, 30, 30);
imageRefView.frame = CGRectMake(515, 5, 30, 30);
commentView.tag = 98;
imageRefView.tag = 99;
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
boolean_t didGetStates = [defaults boolForKey:#"didGetStates"];
MBFancyObject *object = _objects[indexPath.row];
if (didGetStates) {
// State
NSDictionary *dic = [tableData objectAtIndex:indexPath.row];
if (object.beingEdited == -1) {
int selectedState = [[dic valueForKey:#"State"] intValue];
object.selectedIndex = selectedState;
}
// Comment & ImageRef
int comment = [[dic valueForKey:#"Comment"] intValue];
int imageRef = [[dic valueForKey:#"Foto"] intValue];
if (comment == 0) {
[cell.contentView addSubview:commentView];
}
else {
[[cell.contentView viewWithTag:98]removeFromSuperview];
}
if (imageRef == 0) {
[cell.contentView addSubview:imageRefView];
}
else {
[[cell.contentView viewWithTag:99]removeFromSuperview];
}
}
cell.textLabel.text = object.title;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
segmentedControl.selectedSegmentIndex = object.selectedIndex;
object.currentIndexRow = indexPath.row;
cell.backgroundColor = [UIColor clearColor];
cell.textLabel.textColor = [UIColor whiteColor];
return cell;
}
- (IBAction)allOK:(id)sender {
for (MBFancyObject *object in _objects) {
object.selectedIndex = 0;
object.beingEdited = 0;
}
[[self tableView] reloadData];
}
So I hadn't noticed this at my first comment, but your problem here is obvious. You are not properly dequeueing cells from the cell pool, and therefore when you scroll, you are creating a brand new cell EVERY time, which causes them not to have your selected index the way you want. I am pretty sure that your solution lies right here:
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:#"FancyCell"];
cell = nil;
if (!cell) {
You are dequeuing a cell properly, but then immediately setting it to nil, meaning it will ALWAYS go through the !cell check and will ALWAYS create a new cell. Try removing this line and working with the dequeued cell.
Edit:
Since that didn't do it, this is what else I would try:
Create a call to the method willDisplayCell:forRowAtIndexPath:, and in this call check a boolean flag that you set to see if the segmented control at that index should be at index 0 or not. So basically whenever a cell is about to be shown, you check if it's segmented control should be set to index 0, and if it should, set it's index to 0.

image getting overlaped in table view cell

I m parsing a json feed and populating my table view.if my parsed value is "1" and if its for the first four rows of table view cell.i got to make a green checkmark and if its not for the first four rows the checkmark got to be grey check.if my parsed value is null.i got to make no checkmark.everthng works fine.but if i scroll my table view .the check mark images gets overlaped.below is the screen shot and the code.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
//[tableView setSeparatorStyle:UITableViewCellSeparatorStyleNone];
static NSString *CellIdentifier = #"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease];
}
NSDictionary *boy=[self.media1 objectAtIndex:indexPath.row];
NSString *str=[[NSString alloc]initWithFormat:#"%#",boy];
if ([str isEqualToString:#"1"])
{
if(indexPath.row==0||indexPath.row==1||indexPath.row==2||indexPath.row==3)
{
CGRect starFrame = CGRectMake(260, 18, 50, 40);
UIImageView *starImage = [[[UIImageView alloc] initWithFrame:starFrame] autorelease];
starImage.image = [UIImage imageNamed:#"tic.png"];
[cell.contentView addSubview:starImage];
}
else
{
CGRect starFrame1 = CGRectMake(260, 18, 50, 40);
UIImageView *starImage1 = [[[UIImageView alloc] initWithFrame:starFrame1] autorelease];
starImage1.image = [UIImage imageNamed:#"brrr.png"];
[cell.contentView addSubview:starImage1];
}
}
cell.textLabel.text=[story objectAtIndex:indexPath.row];
return cell;
}
You are reusing the cell. So, tableView will return used cell once they are not visible.
To avoid this problem, you should right below code.
if ([str isEqualToString:#"1"])
{
if(indexPath.row==0||indexPath.row==1||indexPath.row==2||indexPath.row==3)
{
CGRect starFrame = CGRectMake(260, 18, 50, 40);
UIImageView *starImage = [[[UIImageView alloc] initWithFrame:starFrame] autorelease];
starImage.image = [UIImage imageNamed:#"tic.png"];
starImage.tag = 1000;
[cell.contentView addSubview:starImage];
}
else
{
CGRect starFrame1 = CGRectMake(260, 18, 50, 40);
UIImageView *starImage1 = [[[UIImageView alloc] initWithFrame:starFrame1] autorelease];
starImage1.image = [UIImage imageNamed:#"brrr.png"];
starImage.tag = 1000;
[cell.contentView addSubview:starImage1];
}
}
else
{
UIImageView *starImage1 = [cell.contentView viewWithTag:1000];
starImage1.image = nil;
}
Use the following code,
if ([str isEqualToString:#"1"])
{
if(indexPath.row==0||indexPath.row==1||indexPath.row==2||indexPath.row==3)
{
CGRect starFrame = CGRectMake(260, 18, 50, 40);
UIImageView *starImage = [[[UIImageView alloc] initWithFrame:starFrame] autorelease];
starImage.image = [UIImage imageNamed:#"tic.png"];
starImage.tag = 1000;
[cell.contentView addSubview:starImage];
}
else
{
CGRect starFrame1 = CGRectMake(260, 18, 50, 40);
UIImageView *starImage1 = [[[UIImageView alloc] initWithFrame:starFrame1] autorelease];
starImage1.image = [UIImage imageNamed:#"brrr.png"];
starImage1.tag = 1000;
[cell.contentView addSubview:starImage1];
}
}
else
{
UIImageView *starImage = [cell.contentView viewWithTag:1000];
if (starImage) {
[starImage removeFromSuperview];
}
}

Adding extra UIlabel to each cell

I'm trying to add an extra UILabel into each cell(UITableView)
I'v succeeded with this code in
(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath method
Here's my code
//add another text
UILabel *test = [[UILabel alloc] initWithFrame:CGRectMake(250,80,50,20.0)];
test.text = [NSString stringWithFormat: #"test"];
test.backgroundColor = [UIColor clearColor];
test.font=[UIFont fontWithName:#"AppleGothic" size:20];
[cell addSubview:test];
However I figured that if I do this, I can't add different text to each cell, instead, it ends up with the same text in all cells. Can anyone tell me how to do that?
Oh and another problem was that if I do this, "test" is displayed in every cell except for the first one.
Have a look at the tutorial "UITableView – Adding subviews to a cell’s content view".
Try something like this
- (UITableViewCell *) getCellContentView:(NSString *)cellIdentifier {
CGRect CellFrame = CGRectMake(0, 0, 320, 65);
CGRect Label1Frame = CGRectMake(17,5,250,18);
UILabel *lblTemp;
UITableViewCell *cell = [[[UITableViewCell alloc] initWithFrame:CellFrame reuseIdentifier:cellIdentifier] autorelease];
lblTemp = [[UILabel alloc] initWithFrame:Label1Frame];
[lblTemp setFont:[UIFont fontWithName:#"Arial-BoldMT" size:15]];
lblTemp.tag = 1;
lblTemp.backgroundColor=[UIColor clearColor];
lblTemp.numberOfLines=0;
[cell.contentView addSubview:lblTemp];
return cell; // this I forgot
}
in cellForRowAtIndexPath
{
if(cell == nil)
cell = [self getCellContentView:CellIdentifier];
UILabel *lblTemp1 = (UILabel *)[cell viewWithTag:1];
lblTemp1.text =[nameArray objectAtIndex:value+indexPath.row];
return cell;
}
For having the same Label on all cells, you are probably instantiating just one cell and use the cellReUseIdentifier for all cells. So, I suggest that you create different labels as properties of the class, and assign each property-label to each cell.
// For example -
if (indexPath.row ==0 )
// assign [cell.contentView addSubview: self.label1];
if (indexPath.row ==1 )
// assign [cell.contentView addSubview: self.label2];
And for the second part of the question, please post your cellForRowAtIndexPath fully - there could be an error in that.
First check if any of the predefined styles work for you.
If you need more flexibility than what they offer, you can try something like this:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = #"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [self makeCell: CellIdentifier];
}
MyData *data = [self.data objectAtIndex:indexPath.row];
UILabel *lbl1 = (UILabel *)[cell viewWithTag:1];
UILabel *lbl2 = (UILabel *)[cell viewWithTag:2];
lbl1.text = data.text;
lbl2.text = data.auxText;
return cell;
}
- (UITableViewCell *)makeLensListCell: (NSString *)identifier
{
CGRect lbl1Frame = CGRectMake(10, 0, 140, 25);
CGRect lbl2Frame = CGRectMake(10, 150, 140, 25);
UILabel *lbl;
UITableViewCell *cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:identifier] autorelease];
// Label with tag 1.
lbl = [[UILabel alloc] initWithFrame:lbl1Frame];
lbl.tag = 1;
[cell.contentView addSubview:lbl];
[lbl release];
// Label with tag 2.
lbl = [[UILabel alloc] initWithFrame:lbl2Frame];
lbl.tag = 2;
lbl.textColor = [UIColor lightGrayColor];
[cell.contentView addSubview:lbl];
[lbl release];
// Add as many labels and other views as you like
return cell;
}
This approach also allows images and other views.

How can i put label into the table cell?

this is the cell i want to make the left side is cell.text and the right part is label.
Now the table style is
UITableViewStyleGrouped When i try to make the label i write these codes.
cell.textLabel.text = #"All";
UIView* view = cell.contentView;
UILabel* label1 = [[UILabel alloc] initWithFrame:cell.frame];
label1.textColor = [UIColor blackColor];
label1.textAlignment = UITextAlignmentCenter;
label1.text = #"%15";
[view addSubview:label1];
[label1 release];
But this doesnt work because cell of the label cover one and another.Can any one help me to make this kind of look with code of course.
The problem in your code seems to be the label1's frame. Change the its frame like the following.
CGRect lFrame = CGRectMake(cell.frame.width - 100, 0, 100, cell.frame.height);
UILabel* label1 = [[UILabel alloc] initWithFrame:lFrame];
Using exisiting style: The style you are using is already predefined. No need to add your custom label to the cell. You can achieve this style by specifying table cell's style to UITableViewCellStyleValue1.
[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 ....
You can change the font properties like style, color and size of the cell's textLabel and detailedTextLabel to fit your needs.
Just make your UITableviewCell type to UITableViewCellStyleValue1 and do like below.
cell.textLabel.text = #"All";
cell.detailTextLabel.text = #"%15";
You don't need to add view in the cell at all. Also, you can change textLable and DetailTextLabel properties whatever you want as you change with UILabel. They are UILabel itself. So you can do everything whatever you can do with UILabel.
Hope this help.
The pre-defined styles are great if they cover your needs.
Otherwise an approach like this one will work for cases where you want more power over the layout, or more views in the cell:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = #"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [self makeCell: CellIdentifier];
}
MyData *data = [self.data objectAtIndex:indexPath.row];
UILabel *lbl1 = (UILabel *)[cell viewWithTag:1];
UILabel *lbl2 = (UILabel *)[cell viewWithTag:2];
lbl1.text = data.text;
lbl2.text = data.auxText;
return cell;
}
- (UITableViewCell *)makeLensListCell: (NSString *)identifier
{
CGRect lbl1Frame = CGRectMake(10, 0, 140, 25);
CGRect lbl2Frame = CGRectMake(10, 150, 140, 25);
UILabel *lbl;
UITableViewCell *cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:identifier] autorelease];
// Label with tag 1.
lbl = [[UILabel alloc] initWithFrame:lbl1Frame];
lbl.tag = 1;
[cell.contentView addSubview:lbl];
[lbl release];
// Label with tag 2.
lbl = [[UILabel alloc] initWithFrame:lbl2Frame];
lbl.tag = 2;
lbl.textColor = [UIColor lightGrayColor];
[cell.contentView addSubview:lbl];
[lbl release];
// Add as many labels and other views as you like
return cell;
}

Objective C: How to implement ABTableViewCell?

I am currently facing serious scrolling performance issues with my UITableView. I have the following subviews in my custom cell
1 X UIImageView
2 X UILabel
3 X UIButtons
I read on the net that having multiple subviews in a custom cell will have serious implications to scrolling performance. I found ABTableViewCell but am not sure how to go about porting my current code over to it.
Snippet of my current code
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString* PlaceholderCellIdentifier = #"PlaceholderCell";
int row = [indexPath row];
SomeClass *thisClass = [self.someClassArray objectAtIndex:row];
CustomCell* cell = (CustomCell*)[tableView dequeueReusableCellWithIdentifier:PlaceholderCellIdentifier];
if (cell == nil)
{
cell = [[[CustomCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:PlaceholderCellIdentifier] autorelease];
//Set Avatar imageview
UIImageView *avatarView = [[UIImageView alloc]initWithFrame:CGRectMake(5, CELL_SPACING,CELL_AVATAR_WIDTH, CELL_AVATAR_HEIGHT)];
avatarView.tag = 1;
//Set text Label
UILabel *textLabel = [[UILabel alloc]initWithFrame:CGRectZero];
textLabel.font = [UIFont fontWithName:#"Helvetica-Bold" size:13.0];
[textLabel setLineBreakMode:UILineBreakModeWordWrap];
textLabel.numberOfLines = 0;
textLabel.tag = 2;
//Add button1
UICustomButton *button = [[UICustomButton alloc]init];
button.tag = 3;
[self.contentView addSubview:avatarView];
[self.contentView addSubview:textlabel];
[self.contentView addSubview:button];
}
//Set Avatar imageview
UIImageView *thisAvatarView = (UIImageView *)[self.contentView viewWithTag:1];
thisAvatarView.image = self.dataForCell.user.avatar;
//Set data to text Label
NSString *text = [NSString stringWithFormat:#"%#",self.dataForCell.text];
CGFloat answerLabelHeight = [CustomCell getHeightOfLabel:self.dataForCell ofType:#"XXX"];
UILabel *thisTextLabel = (UILabel*)[self.contentView viewWithTag:2];
[thisTextLabel setFrame:CGRectMake(CELL_TEXT_LEFT_MARGIN, CELL_SPACING+CELL_USERNAMELABEL_HEIGHT+questionLabelheight,CELL_CONTENT_WIDTH - CELL_TEXT_LEFT_MARGIN*1.5, answerLabelHeight)];
thisTextLabel.text = someData;
//Set data to button
UICustomButton *thisButton = (UICustomButton *)[self.contentView viewWithTag:3];
[thisButton setButtonWithAnswer:self.dataForCell buttonType:#"like" navcon:self.navcon andFrame:CGRectMake(CELL_TEXT_LEFT_MARGIN, totalCommentLabelHeight + CELL_SPACING*4, 45, CELL_BUTTON_HEIGHT)];
thisLikeButton.imageView.image = [UIImage imageNamed:#"xxxx.png"];
}
Sorry for the long code, but can anyone guide me along on how I can start to use ABTableViewCell for this implementation?