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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T04:51:39+00:00 2026-06-17T04:51:39+00:00

i have 2 views-view1 and view2, one for entering data and another for displaying

  • 0

i have 2 views-view1 and view2, one for entering data and another for displaying the entered data.
I am able to display the entered data in view2 in labels. But how to display the data in a UITableView. Following is my code to display the data:

view2.m

@synthesize details; //details is an object of NSMutableArray.
    - (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];

    textLabel.text = self.name;
    lblCity.text = self.city;
    lblGender.text = self.gender;


}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return [details count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *simpleTableIdentifier = @"SimpleTableItem";

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier];

    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:simpleTableIdentifier];
    }

    cell.textLabel.text = [details objectAtIndex:indexPath.row];
    //cell.imageView.image = [UIImage imageNamed:@"creme_brelee.jpg"];
    return cell;

i debuuged and found that cellForRowAtIndexPath is never called.

Where am i getting wrong? How do i solve it?

  • 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-17T04:51:40+00:00Added an answer on June 17, 2026 at 4:51 am

    You need to create a NSMutableArray of display Data in to UITableViewCell like below and don’t forget to declare UITableView delegates in .h file <UITableViewDataSource,UITableViewDelegate> and also connect your UITableView IBOutlet in your xib and also connect the delegate:

    - (void)viewDidLoad
    {
        [super viewDidLoad];
        arrCategorisation=[[NSMutableArray alloc] initWithObjects:@"DataOne",@"DataTwo",@"DataThree", @"DataFour",@"DataFive",nil];
    }
    
    #pragma mark - Table view data source
    
    - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
    {
        // Return the number of sections.
        return 1;
    }
    
    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
    {
        return arrCategorisation.count;
    }
    
    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
    {
        NSString *CellIdentifier =[NSString stringWithFormat:@"%d",indexPath.row];
        UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
        if (cell == nil) {
            cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
    
                cell.textLabel.text=[arrCategorisation objectAtIndex:indexPath.row];
    
        }
    
        // Configure the cell...
    
        return cell;
    }
    
    #pragma mark - Table view delegate
    
    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
    {
    
    }
    

    your Table load data like:-

    enter image description here

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

Sidebar

Related Questions

I have two views within one .xib (one view for landscape, another for portrait).
I have created one keyboard.When user enter numbers , its entering particular EditText.But When
I have one ViewModel and two Views. How can I navigate to View2 from
I have 2 views 1 view has NSTextFields (viewA) the other one (viewB) just
I have two views, one view takes the whole screen, the second view covers
I have 2 customer views one for create and one for edit. I am
I have an app that have several views. In one view I would like
I have two views in my ViewFlipper . One of views contains a ListView
I have 2 views, one called PostToPalPal as below and DomainConfirmationView. On the DomainConfirmationView
I have two views that I would like to combine into one. The first

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.