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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T23:48:28+00:00 2026-05-23T23:48:28+00:00

I have an iPhone app (in XCode 4) that uses the standard Tab Bar

  • 0

I have an iPhone app (in XCode 4) that uses the standard Tab Bar Application project template (UITabBarController).

My first view has a UITableView that gets data from a JSON feed. Here’s where the controller loads that data:

#import "FirstViewController.h"
#import "SBJson.h"
#import "WheelRecord.h"
#import "WheelTableCell.h"
#import "UIImageView+WebCache.h"

@implementation FirstViewController

@synthesize wheels, wheelsTable;

- (NSMutableArray *) wheels {
    if (!wheels) {     
        SBJsonParser *parser = [[SBJsonParser alloc] init];        
        NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://wheelspotting.com/recent.json"]];            
        NSData *response = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil];            
        NSString *json_string = [[NSString alloc] initWithData:response encoding:NSUTF8StringEncoding];
        NSArray *wheelData = [parser objectWithString:json_string error:nil];            
        self.wheels = [NSMutableArray array];
        for (NSDictionary *wheel in wheelData)
        {
            WheelRecord *currentWheel = [[[WheelRecord alloc] init] autorelease];
            currentWheel.title = [wheel objectForKey:@"title"];
            currentWheel.smallImage = [wheel objectForKey:@"small_image"];
            currentWheel.mediumImage = [wheel objectForKey:@"medium_image"];
            currentWheel.largeImage = [wheel objectForKey:@"large_image"];                
            [self.wheels addObject:currentWheel];
        }

    }
    return wheels;
}

I’m trying to reload that data any time the user selects a different tab and then goes back to the first tab.

I’ve tried setting wheels to nil in viewDidLoad and viewWillAppear but when I switch tabs and come back to the first tab, it never updates (I make changes to the data to test).

  • 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-23T23:48:29+00:00Added an answer on May 23, 2026 at 11:48 pm

    I don’t believe that ViewDidLoad will be called again as all the view controllers will be present at all times. I would have thought that viewWillAppear should have been called though.

    Silly question, but are you sure the data is not being updated? Perhaps it’s just your table view that’s not being updated with the new data? You are calling [yourTableView reloadData] somewhere from within your viewWillAppear or viewDidAppear method? Alternatively, pop a [yourTableView reloadData] just before the end of your if code, eg

           [self.wheels addObject:currentWheel];
           [yourTableView reloadData]; // where yourTableView is the pointer to your table view
        }
    

    Tab bar controllers can be awkward things to work with, I know I’ve personally spent many hours swearing at them. One thing to try, if you’ve subclassed UIViewController in any way, or are using a UITableViewController or UINavigationController make sure you’ve set the correct object type in the inspector for relevant tab – I’ve had no end of problems due to forgetting to do this in the past.

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

Sidebar

Related Questions

I have an iPhone app that hides the status bar. However, my main view
I have an iphone app that uses table view as the interface. Each time
I'm currently programming an app for iphone that uses the tab bar. One of
I have a 32bit iMac that I am writing an iPhone app in Xcode
I have an iphone app that uses Core Data to do storage. I have
I have an iPhone (Xcode) Project that was working fine. Something must have been
I'm trying to compile an iPhone app that uses CorePlot. I'm using XCode 4.
I work on a project for iPhone iOS4 with Xcode 4. My app uses
I have an iPhone app which was built using a standard UITabBarController. This app
I have an iPhone app that I run on the simulator. XCode ver 3.2.6/4.3.

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.