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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:25:25+00:00 2026-05-25T23:25:25+00:00

I am able to get data from plist but it seems my cellForRowAtIndexPath is

  • 0

I am able to get data from plist but it seems my cellForRowAtIndexPath is not getting called as none of NSLog printing anything from inside the method.

here is my code :-

- (void)viewDidLoad
{
    NSString *path = [[NSBundle mainBundle] pathForResource:@"drinks" ofType:@"plist"];

    NSMutableDictionary *tempDict = [[NSMutableDictionary alloc] initWithContentsOfFile:path];
    self.drinks = [tempDict objectForKey:@"Root"];
    NSLog(@"%@", self.drinks);
    NSLog(@"Number = %d", self.drinks.count);    
    [super viewDidLoad];
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
NSLog(@"I am inside cellForRowAtIndexPath");
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}

// Configure the cell.
NSArray *allValues = [self.drinks valueForKey:@"name"];    
NSLog(@"%d", allValues.count);
cell.textLabel.text = [allValues objectAtIndex:indexPath.row];

return cell;

}

Here is my console output :-

2011-10-01 20:27:01.940 DrinkMixer[1832:b303] (
        {
        directions = "Shake adahsdk adlkasd";
        ingredients = "kslkds lkjsjlkd kjsljlakj aajdlkj";
        name = "Fire Cracker";
    },
        {
        directions = "abds fedfsdkkjkljlkj;j ok";
        ingredients = "hasdhalsdlash asdhasldh kjdfkjshdj";
        name = "Lemon Drop";
    },
        {
        directions = "abds fedfsdkkjkljlkj;j ok";
        ingredients = "hasdhalsdlash asdhasldh kjdfkjshdj";
        name = Mojito;
    },
        {
        directions = "abds fedfsdkkjkljlkj;j ok";
        ingredients = "hasdhalsdlash asdhasldh kjdfkjshdj";
        name = "After Drink Mint";
    },
        {
        directions = "abds fedfsdkkjkljlkj;j ok";
        ingredients = "hasdhalsdlash asdhasldh kjdfkjshdj";
        name = "Apple Martini";
    },
        {
        directions = "abds fedfsdkkjkljlkj;j ok";
        ingredients = "hasdhalsdlash asdhasldh kjdfkjshdj";
        name = "Shockwave";
    },
        {
        directions = "abds fedfsdkkjkljlkj;j ok";
        ingredients = "hasdhalsdlash asdhasldh kjdfkjshdj";
        name = "Beer";
    },
        {
        directions = "abds fedfsdkkjkljlkj;j ok";
        ingredients = "hasdhalsdlash asdhasldh kjdfkjshdj";
        name = "Last Desire";
    },
        {
        directions = "abds fedfsdkkjkljlkj;j ok";
        ingredients = "hasdhalsdlash asdhasldh kjdfkjshdj";
        name = "Vodka";
    }
)
2011-10-01 20:27:01.942 DrinkMixer[1832:b303] Number = 9

None of cellForRowAtIndexPath’s NSLog get called.

Can anyone please tell what is wrong with this code.

Thanks.

  • 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-05-25T23:25:26+00:00Added an answer on May 25, 2026 at 11:25 pm

    Odds are that you either have not implemented UITableViewDelegate in your header file, or your UITableView‘s datasource and delegate are not wired up in your nib file.

    I suggest checking out the datasource.

    UPDATE:

    The fact that the tableView:cellForRowAtIndexPath: isn’t being called and the datasource is set correctly then it could be that the plist is loaded into self.drinks after the UITableView is already loaded. Proof could be to scroll the empty UITableView up and down and see if cells from off the screen start to appear.

    I suggest two things:

    1. call [super viewDidLoad]; at the beginning of your -(void)viewDidLoad

    2. call for a reload your UITableView after the plist is loaded.

    Try:

    - (void)viewDidLoad {
    
        [super viewDidLoad];
    
        NSString *path = [[NSBundle mainBundle] pathForResource:@"drinks" ofType:@"plist"];
    
        NSMutableDictionary *tempDict = [[NSMutableDictionary alloc] initWithContentsOfFile:path];
        self.drinks = [tempDict objectForKey:@"Root"];
        NSLog(@"%@", self.drinks);
        NSLog(@"Number = %d", self.drinks.count);    
    
        [yourTableView reload];
    
    }
    

    Lastly, the reason I worry about your datasource is because I think even an empty cell should call tableView:cellForRowAtIndexPath:

    Hope this helps.

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

Sidebar

Related Questions

I want to insert data from database to table. I am able to get
I am able to get data from a URL with the following structure -
I am able to get data from doPost() in java servlet and process the
People don't seem to be able to get the data from the cube unless
I am trying to get data from a site and be able to manipulate
I would like to be able to get html-formatted data from mysql, and turn
I need to be able get a single specific attribute from an element with
I'm able to get cells to format as Dates, but I've been unable to
I am not able to get my jwysiwyg and Jhtmlarea text editors to work
I am able to get the feed from the spreadsheet and worksheet ID. I

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.