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 8217761
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T12:33:44+00:00 2026-06-07T12:33:44+00:00

I have an Iphone application in which i am combining two arrays and displaying

  • 0

I have an Iphone application in which i am combining two arrays and displaying in the same table.the problem here is i was not able to change the position of the detailed textlabel in the cell.here is my code snippet `

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease];
        UIImageView* img = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"cell_with_arrow.png"]];
        [cell setBackgroundView:img];
        [img release];        
    }
    if(newssarray==nil||[newssarray count]==0)
    {            
    }
    else
    {
        NSDictionary *dicttable=[newssarray objectAtIndex:indexPath.row];
        head=[dicttable objectForKey:@"news"];
        head1=[dicttable objectForKey:@"name"];
        NSString *sub=[dicttable objectForKey:@"created"];

        NSLog (@"%@",head);

        [[cell viewWithTag:12] removeFromSuperview];
        [[cell viewWithTag:13] removeFromSuperview];
         [[cell viewWithTag:14] removeFromSuperview];

        UIButton *shopLabel=[self buttonWithText:head andFrame:CGRectMake(49, 12, 250,5)] ;
        shopLabel.tag=12;
        //shopLabel.autoresizingMask=UIViewAutoresizingFlexibleRightMargin;
        [shopLabel addTarget:self action:@selector(openRestaurantsList) forControlEvents:UIControlEventTouchUpInside];

        UIButton *shopLabel1=[self buttonWithText:head1 andFrame:CGRectMake(49, 12, 250,5)] ;
        shopLabel1.tag=14;
        //shopLabel.autoresizingMask=UIViewAutoresizingFlexibleRightMargin;
        [shopLabel1 addTarget:self action:@selector(openRestaurantsList) forControlEvents:UIControlEventTouchUpInside];
        cell.detailTextLabel.frame = CGRectMake(49, 30, 150,5);
        if(indexPath.row < [newsseperatearray count])
        {
            UIImage *cellImage = [UIImage imageNamed:@"news.png"];
            cell.imageView.image = cellImage;
            //NSStringEncoding encoding=NSASCIIStringEncoding;
            cell.imageView.frame=CGRectMake(0,0,48,48);
            cell.imageView.bounds=CGRectMake(0,0,48,48);
            [cell.imageView setClipsToBounds:NO];
            NSLog(@"%@",sub);                     
            cell.detailTextLabel.text = sub;
            cell.detailTextLabel.backgroundColor = [UIColor clearColor];
        }
        else
        {
            UIImage *cellImage = [UIImage imageNamed:@"menu_icon.png"];
            cell.imageView.image = cellImage;
            //NSStringEncoding encoding=NSASCIIStringEncoding;
            cell.imageView.frame=CGRectMake(0,0,48,48);
            cell.imageView.bounds=CGRectMake(0,0,48,48);
            [cell.imageView setClipsToBounds:NO];
        }
        [cell addSubview:shopLabel];
        [cell addSubview:shopLabel1];
        // [cell addSubview:shopLabel2];
    }
    return cell;
}

`can anybody help me to achieve this?

  • 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-06-07T12:33:47+00:00Added an answer on June 7, 2026 at 12:33 pm

    Make a UITableViewCell subclass, keep that cell style as UITableViewCellStyleSubtitle, and override layoutSubviews in that subclass. You can then change the frame of detailTextLabel (just make sure to call the super implementation of layoutSubviews in your method).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an Iphone application in which i am using two types of purchases.Non
Currently i am working on a iPhone Application Which is displaying video. I have
I have an IPhone application in which i want to change the background image
I have iphone application in which I am downloading images from server & displaying
I have an iPhone application in which i am trying to add two mutable
I have an Iphone application in which i am trying to load the two
I have an iphone application which has about 4 tabs. How do I force
I have an iPhone application which basically is getting information from an API (in
I have an iPhone application which in which I want to perform a method
I have an IPhone application which is having a non consumable in app purchse

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.