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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:21:28+00:00 2026-05-27T02:21:28+00:00

I have a UITableView and I want some cells to be the standard UITableViewCells

  • 0

I have a UITableView and I want some cells to be the standard UITableViewCells and I have one custom cell, called ImageTableViewCell. I have set this custom cell in IB and have linked with its header and implementation.

The cell loads fine into my view along with the standard cells, but my data is not being put into the cell at runtime. Here is the code I am using. Do you notice anything wrong?

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = nil;
    if (tableView == self.visitTableView && indexPath.section == 0 && indexPath.row == 0){
        CellIdentifier = @"imageCell";
    }
    else{
        CellIdentifier = @"cell";
        }
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    ImageTableViewCell *imageCell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

    if (tableView == self.visitTableView)
    {
        if (indexPath.section == 0)
        {
            switch (indexPath.row) {
                case 0:
                    imageCell.patientNameLabel = [self.appointmentDictionary objectForKey:@"patient"];
                    [imageCell.patientImage setImageWithURL:[NSURL URLWithString:[self.appointmentDictionary objectForKey:@"patient_small_photo_url"]] placeholderImage:nil];
                    break;
                case 1:
                    cell.textLabel.text = @"Appointment";
                    cell.detailTextLabel.text = [self.appointmentDictionary objectForKey:@"scheduled_time"];
                    break;                
                default:
                    break;
                }
        }
  • 1 1 Answer
  • 3 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-27T02:21:29+00:00Added an answer on May 27, 2026 at 2:21 am

    Well, your last comment is the problem. You dequeue two cells, and then configure the second and return the first.

    To get a pointer to ImageTableViewCell, just cast the UITableViewCell pointer, like so:

    ImageTableViewCell *imageCell = (ImageTableViewCell*)cell;
    

    And also remove this:

     ImageTableViewCell *imageCell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    

    And then you can go ahead and return ‘cell’ for either case.

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

Sidebar

Related Questions

i have a UITableView where i want one cell(database row) needs to be default,
I have a UITableView with some custom cells in it. In these custom cells
In my ViewController, I have a UITableView with some custom cells in it. When
I have UiTableView containing some data, and I want to scroll the UiTableViewCells horizontally
In my Universal App I have a long UITableView with custom cells..and for some
Hi i have a working UITableViewController and UITableView with custom cells but i want
I have a UITableView that I want to edit inside of a UITableViewController. This
I have a full list that populates a UITableView . This I want to
I have a UITableView that displays images, but I want some text to be
I have a UITableView where some rows are indented using indentationLevel. Cells have the

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.