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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T17:55:03+00:00 2026-06-08T17:55:03+00:00

to the point, i have custom cells, inside it has 2 label and 1

  • 0

to the point, i have custom cells, inside it has 2 label and 1 textfield. both label and textfield got input from user. i also have other view that has uitableview inside it. my question is how do i populate cell in uitableview? please help.

this is my code inside tableviewcontroller.

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 1; // i want to populate this using 'count' but i dont know how.
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    CustomCell *cell = (CustomCell *)[tableView dequeueReusableCellWithIdentifier:[CustomCell reuseIdentifier]];
    if (cell == nil)
    {
        [[NSBundle mainBundle] loadNibNamed:@"CustomCell" owner:self options:nil];
        cell = _customCell;
        _customCell = nil;
    }       
    cell.titleLabel.text = [NSString stringWithFormat:@"%@",titleTextString];
    cell.timerLabel.text = [NSString stringWithFormat:@"%@",timerString];
    cell.statusLabel.text = [NSString stringWithFormat:@"%@",statusString];

    return cell;    
}

how do i populate my tableview if i push add button after finishing input by user? Please if you dont mind help me with code. i’m beginner and im hard to understand by using opinion.

  • 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-08T17:55:05+00:00Added an answer on June 8, 2026 at 5:55 pm

    If I understood your question correctly, you did a custom nib file for your cells that has 2 UILabel in it and one UITextField, and you want to access these objects when populating your table. Here are some steps for this issue:

    First, you have to give a tag number for each object in your custom cell. You find this property in the Attribute Inspector in Interface Builder. Say you gave the first label tag 1, the second label 2 and the text field 3.

    Second you have to give a. Identifier for this nib file, for example MyCustomCellIdentifier. This identifier will be used later on in the view that has the table so you can link to it.

    Third, also in the custom cell nib, you click on the yellow square that says File’s Owner and in the Identity Inspector you change the Class to the class name that has the table that will use this custom cell.

    Fourth, in the class that you have the table that will use the custom cell, create an outlet of type UITableViewCell. We will link this in the custom nib cell.

    Fifth, goto the custom nib cell, click on the cell window, then in the Connections Inspector link New Referencing Outlet to the File’s Owner, you will see the outlet that you created in the table class showing here, simply link to it.

    Now since the connections are established thing are more easy, in the cellForRowAtIndexPath function (in the class that contains the table for sure), you have to load the custom cell from the nib file as follows:

    static NSString *tableIdentifier = @"MyCustomCellIdentifier";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:tableIdentifier];
    if(cell == nil)
    {
        NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"TheNibClassNameOfYourCustomCell" owner:self options:nil];
        if([nib count] > 0) cell = theNameOfTheOutletYouUsed;
        else NSLog(@"Failed to load from nib file.");
    }
    

    Ok, your custom cell is loaded in variable cell, now you have to access every object in it from the tags you created:

    UILabel *label1 = (UILabel *)[cell viewWithTag:1];
    UILabel *label2 = (UILabel *)[cell viewWithTag:2];
    UITextField *textField1 = (UITextField *)[cell viewWithTag:3];
    

    Now you can access everything through label1, label2, and textField1 easily like label1.text = @"Hi";

    I hope this answers your question.

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

Sidebar

Related Questions

In my installer I have set WixUIBannerBmp to point to my own custom dialog-banner.bmp
I have a point, and a point normal defined to it. Suppose I also
I have a UITableView with custom cells. The cells containing one UITextView each and
I just have a quick best practice question regarding custom cells in a UITableView.
I have a TableView loading a custom cell and loading the data from a
Setup: I have a custom class I've created that handles data retrieved from a
I have a table view that displays custom cells, the cells contain an image
I have a JList that will point to a selected JList depending on user.
I'm doing custom drawing in datagridview cells and I have items that can vertically
I have a custom validator that points to a Client side script to validate

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.