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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T08:16:42+00:00 2026-06-08T08:16:42+00:00

I have written a class for UITableViewCell called TaskCell and designed a .xib file

  • 0

I have written a class for UITableViewCell called TaskCell and designed a .xib file and connected the File’s Owner to the custom class. Then in the View Controller class I want to load the custom design, but it is not showing. This is the code for the View Controller with table view:

ShowTaskViewController.h file:

@interface ShowTaskViewController : UIViewController <UITableViewDataSource,UITableViewDelegate>
{
    //Database object
    sqlite3 *taskeeDB;
    NSString *databasePath; 
}
@end

ShowTaskViewController.m file with cell for row at index path method:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Cell"; 
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

    //Get data for cell
    AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
    Task *taskObj1 = (Task *)[appDelegate.taskArray objectAtIndex:indexPath.row];
    NSString *sName = [[NSString alloc] initWithFormat:@"%@",taskObj1.name];
    NSString *sLoc = [[NSString alloc] initWithFormat:@"%@",taskObj1.location];
    NSString *sTime = [[NSString alloc] initWithFormat:@"%@",taskObj1.time];
    NSString *sDate = [[NSString alloc] initWithFormat:@"%@",taskObj1.date];

    //Configure cell if null
    if (cell == nil) {
        //I have written a custom init method to take parameters and assign label text values
        cell = [[TaskCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier name:sName location:sLoc time:sTime date:sDate];
    }
return cell;
}

If cell is null from dequeue cell list, I am assigning new cell objects where TaskCell is the custom UITableViewCell class. Am I doing the correct process?

Show I try to create the cells as following?

if (cell == nil){
    NSArray *objects = [[NSBundle mainBundle] loadNibNamed:@"TaskCell" owner:self options:nil];
    for (id currentObjects in objects  ) { 
        if ([currentObjects isKindOfClass:[UITableViewCell class]]) {
            cell = (TaskCell*) currentObjects;
            break;
        }
    }
}
  • 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-08T08:16:44+00:00Added an answer on June 8, 2026 at 8:16 am

    I guess the following change would help you!!

      - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
        {
    
        static NSString *CellIdentifier = @"Cell"; 
        TaskCell *cell = (TaskCell*)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    
        //Get data for cell
        AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
        Task *taskObj1 = (Task *)[appDelegate.taskArray objectAtIndex:indexPath.row];
        NSString *sName = [[NSString alloc] initWithFormat:@"%@",taskObj1.name];
        NSString *sLoc = [[NSString alloc] initWithFormat:@"%@",taskObj1.location];
        NSString *sTime = [[NSString alloc] initWithFormat:@"%@",taskObj1.time];
        NSString *sDate = [[NSString alloc] initWithFormat:@"%@",taskObj1.date];
    
        //Configure cell if null
        if (cell == nil) {
            //I have written a custom init method to take parameters and assign label text values
            cell = [[TaskCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier name:sName location:sLoc time:sTime date:sDate];
        }
    return cell;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written a custom class to handle database queries to a remote and
I have written a custom class for overriding the seek method of QSlider. Basically
I have designed an ASP.NET page which create graphs. I have written a class
I have written a class called ArchivedFilesWrapper in the App_code folder of my project,
I have written a class called QueueManager: class QueueManager { Queue functionsQueue; public bool
I have written a ListActivity class that uses a custom ArrayAdapter and Holders. I
I have written a class to load an XML file but I always get
I have written a class in python that implements __str__(self) but when I use
I have written a class using std::tr1::regex, and I don't know how to link
I have written a class that will handle internal logging in my application. Now

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.