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

  • Home
  • SEARCH
  • 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 6952513
In Process

The Archive Base Latest Questions

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

I’m a novice programmer working through The Complete Idiot’s Guide to iPad & iPhone

  • 0

I’m a novice programmer working through “The Complete Idiot’s Guide to iPad & iPhone App Development” by Troy Brant (my problem is in Chapter 14, the “Frenemy” app). At the time of publication Xcode 4.2 did not exist. This fact and the fact that the book is laden with typo’s has made this learning experience frustrating but valuable. Alas, I have come upon an issue I seem to be unable to solve. I have created a table view and populated it with twitter usernames. I have followed the book to the letter and even downloaded the author’s “finished” source code. At runtime, all that happens is my table view and navigation bar display but the table is completely empty. When I run his “finished” source code, the exact same thing happens. My question is: is there a specific method I should be calling (like updateInterface, for example) in order to display the data I’ve told the table to gather or should the…

-(void)viewDidLoad
{
    [super viewDidLoad];

    self.title = @"Frenemies";

    frenemiesTableView.dataSource = self;
    frenemiesTableView.delegate = self;   
}

…method suffice? Also, if I should be calling an updateInterface relative, how do I define that method? I’ve been using this website all week and finally decided to sign up and ask my first question because you guys have been able to steer me to great answers so far. I greatly appreciate any advice.

the following is in my FrenemiesViewController.m Class:

-(NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    //following line tells the table to create as many rows as rootUser has frenemies
    return [rootUser.frenemies count];
}


//give the table view the cell to display for a single row

- (UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    //REUSE CELLS FOR BEST SCROLLING PERFORMANCE
    static NSString *cellId = @"cellId";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
    if (!cell)
    {
        //create a cell only if one couldn't be reused
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellId];
    }

    //DISPLAY FRENEMY'S NAME INSIDE THE CELL
    NSDictionary *frenemyDict = [rootUser.frenemies objectAtIndex:indexPath.row];
    cell.textLabel.text = [frenemyDict objectForKey:@"name"];
    return cell;
}
  • 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-27T14:21:32+00:00Added an answer on May 27, 2026 at 2:21 pm

    You are not showing us your dataSource. Your table needs some kind of data to load.

    - (void)viewDidLoad
    {
        [super viewDidLoad];
    
        self.title = @"Frenemies";
    
        frenemiesTableView.dataSource = self;
        frenemiesTableView.delegate = self;  
    
        someArray = [NSArray arrayWithObjects:@"One",@"Two",@"Three",nil];
    }
    

    Return the number of objects in someArray.

    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
        return [someArray count];
    }
    

    Load someArray into the table:

    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
    {
        static NSString *CellIdentifier = @"Cell";
        UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];    
        if (cell == nil) {
            cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
        }
    
        cell.textLabel.text = [someArray objectAtIndex:indexPath.row];
    
        return cell;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
We're building an app, our first using Rails 3, and we're having to build
I am writing an app with both english and french support. The app requests
I am using Paperclip to handle profile photo uploads in my app. They upload
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I am trying to loop through a bunch of documents I have to put
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and

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.