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

  • SEARCH
  • Home
  • 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 6979749
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:55:32+00:00 2026-05-27T17:55:32+00:00

In my iPhone app, In Table view I have Two labels in one cell..

  • 0

In my iPhone app,

In Table view

I have Two labels in one cell..

  1. textLabel which is default.
  2. Custom Label

Data is deleting from array which is fine…

Here is the code..

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{

    //Get the Log Id for the sections. From Section Array
    int logID=0;
    if(indexPath.row==0)
    {
        NSLog(@"Time Array %@",timeArray);
        logID=[[[sectionArray objectAtIndex:indexPath.section] valueForKey:@"logID"] intValue];
        NSPredicate *p=[NSPredicate predicateWithFormat:@"logID==%d",logID];
        fillRows=nil;
        fillRows= [[timeArray filteredArrayUsingPredicate:p] mutableCopy];
    }



    static NSString *CellIdentifier = @"Cell";



    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:CellIdentifier] autorelease];

    }



//Show Current Time.
//"If condition for not to go for Array Index Out of Bound".
if(indexPath.row<[fillRows count])
{
//Log CurrentTime    
    cell.textLabel.text=[[fillRows objectAtIndex:indexPath.row] valueForKey:@"logCurrentTime"];
    [cell.textLabel setTextColor:[UIColor whiteColor]];
//Log Duration.   
   UILabel *lblDuration=[[[UILabel alloc] initWithFrame:CGRectMake(110, 11, 60, 21)] autorelease];
   [lblDuration setTextColor:[UIColor whiteColor]];
        [lblDuration setBackgroundColor:[UIColor clearColor]];
        [lblDuration setFont:[UIFont boldSystemFontOfSize:18]];
   lblDuration.text=[[fillRows objectAtIndex:indexPath.row] valueForKey:@"logDuration"];
        [cell.contentView addSubview:lblDuration];
   }

    return cell;
}

Thanks in advance 🙂

  • 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-27T17:55:33+00:00Added an answer on May 27, 2026 at 5:55 pm

    Answer is this…
    that why the label of the cell which was deleted from te table stuck to the cell…

    Just see I have commented two lines of codes……

    Where cell==nil..

      - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
        {
    
            //Get the Log Id for the sections. From Section Array
    
            static NSString *CellIdentifier = @"Cell";
    
    
    
            **UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
         //   if (cell == nil) {
                cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:CellIdentifier] autorelease];
    
           // }**
    
    
    
        /if(indexPath.row<[fillRows count])
        {
        //Log CurrentTime    
            cell.textLabel.text=[[fillRows objectAtIndex:indexPath.row] valueForKey:@"logCurrentTime"];
            [cell.textLabel setTextColor:[UIColor whiteColor]];
        //Log Duration.   
           UILabel *lblDuration=[[[UILabel alloc] initWithFrame:CGRectMake(110, 11, 60, 21)] autorelease];
           [lblDuration setTextColor:[UIColor whiteColor]];
                [lblDuration setBackgroundColor:[UIColor clearColor]];
                [lblDuration setFont:[UIFont boldSystemFontOfSize:18]];
           lblDuration.text=[[fillRows objectAtIndex:indexPath.row] valueForKey:@"logDuration"];
                [cell.contentView addSubview:lblDuration];
           }
    
            return cell;
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For my iPhone app, I have an editable (for delete) table view. I'd like
I have an iphone app that uses table view as the interface. Each time
In my iPhone app, I am having a grouped table view. I have used
I have an iphone app. The view is consists of two children: a tableview
I'm building an iphone app and I've got a table view with some textfields
I'm working on an table drill-down style iPhone app that has prepopulated data. I
I'm working on a navigation-based iPhone-only app that serves two main purposes: One, to
In my iPhone app I have two viewControllers: viewController1 has a tableView that shows
I'm having some trouble with an iPhone app that I'm making. I have two
In twitter iPhone app, on My Profile view, there is a section with two

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.