Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7438119
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:30:18+00:00 2026-05-29T10:30:18+00:00

I m parsing a json feed and populating my table view.if my parsed value

  • 0

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;
   }

enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T10:30:19+00:00Added an answer on May 29, 2026 at 10:30 am

    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];
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i m parsing json feed and according to the parsed value i m placing
I m parsing json data and assigning it in my table view cell.where in
I am parsing two json feeds. The first json feed parses pharmacies of a
I'm parsing a json feed routinely and need to insert only the newest users
I have a list of places in listview which i got from parsing JSON.
I am downloading and parsing JSON objects to build a news feed to populate
I m parsing a json feed containing three tags they are Name,Status,Image and storing
I need help with parsing of JSON feed text returned from Twitter. I need
When parsing json service , it works fine for first time , but during
I got an error in parsing JSON on Android. This is my JSON method:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.