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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:24:31+00:00 2026-06-01T16:24:31+00:00

I have a problem layout the objects in the code. Here is a picture

  • 0

I have a problem layout the objects in the code.
Here is a picture of current and desired status:

enter image description here

And here is the code

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];    
if (self) {
    self.title = NSLocalizedString(@"My Favorites", @"My Favorites");
    self.tabBarItem.image = [UIImage imageNamed:@"second"];

}    

favoritesTable = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, 320, 364) style:UITableViewStylePlain];
[favoritesTable setHidden:NO];
[favoritesTable setDelegate:self];
[favoritesTable setDataSource:self];

[self.view addSubview:favoritesTable];        

[favoritesTable release];

return self;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cellIdentifier = @"<#MyCell#>";

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if (cell == nil) {
    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier] autorelease];
}

NSInteger objectLocation = indexPath.row;

FoodData* food = (FoodData*)[resultsArray objectAtIndex:objectLocation];    

cell.imageView.image = [UIImage imageNamed:@"paris.jpg"];
cell.imageView.frame = CGRectMake(270, 4, 40, 36);    

cell.imageView.userInteractionEnabled = YES;
cell.imageView.tag = indexPath.row;

UILabel* lblText = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 260, 20)];
UILabel* lblType = [[UILabel alloc] initWithFrame:CGRectMake(0, 21, 260, 20)];

[lblText setFont:[UIFont fontWithName:@"Helvetica" size:10.0]];
[lblType setFont:[UIFont fontWithName:@"Helvetica" size:9.0]];

lblType.textColor = [UIColor blueColor  ];

[lblText setText:[food foodName]];
[lblType setText:[food foodType]];

[cell addSubview:lblText];
[cell addSubview:lblType];

[lblText release];
[lblType release];

return cell;
}
  • 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-01T16:24:32+00:00Added an answer on June 1, 2026 at 4:24 pm

    on ios5, making use of the prototype cell on the IB will be the easiest way out for you.

    if you are not on ios 5, i do highly recommending using a custom tableviewcell.

    The short solution to your issue can be found here in the link below.

    UITableViewCell with image on the right?

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

Sidebar

Related Questions

I have a problem with layout. Look at the picture: as you can see
I have to make a simple layout in android but have problem with the
I have a reasonably complex layout problem: I would like to have a main
I have the age-old problem of a div wrapping a two-column layout. My sidebar
Here's my problem: I've have an application with tabs. in each tab I have
I have some problem with complex objects on tabpanel. I have 2 complex objects
Here is some of the main code for a little app I have made
Here is the setup (extraneous layout code removed): Window.xaml <Button Name=btn_Next Command=NextPage>Next</Button> <ContentControl Name=contentControl1
I have problems getting some of my views aligned in a relative layout that
I have problem creating new instance of excel 2007 using VBA (from Access 2002).

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.