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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:46:58+00:00 2026-06-11T00:46:58+00:00

Im developing an IOS 5 app which takes a feed from a url and

  • 0

Im developing an IOS 5 app which takes a feed from a url and displays the posts in a tableview. I have a View controller that loads the table cells with the posts in the feed. This all works perfectly.

However, i wanted to use the SVProgressHUD to show whilst the feed is being loaded in a separate thread.

So in my -(void)viewDidLoad method I have the following:

- (void)viewDidLoad
{
    [super viewDidLoad];
    [SVProgressHUD showInView:self.view status:@"loading.." networkIndicator:YES];
    dispatch_async(kBgQueue, ^{NSData* data = [NSData dataWithContentsOfURL: latestFeedURL];
    [self performSelectorOnMainThread:@selector(fetchedData:) withObject:data waitUntilDone:YES];});

    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(foregroundRefresh:) name:UIApplicationWillEnterForegroundNotification object:nil];

    self.pull = [[PullToRefreshView alloc] initWithScrollView:(UIScrollView *) self.feedTableView];
    [self.pull setDelegate:self];
    [self.feedTableView addSubview:self.pull];

    self.title = @"Latest";
}

- (void)fetchedData:(NSData *)responseData {
    //parse out the json data
    NSError* error;
    NSDictionary* json = [NSJSONSerialization JSONObjectWithData:responseData options:kNilOptions error:&error];

    NSMutableArray* latestFeed = [json objectForKey:@"posts"]; //2

    self.feedUpLoads = latestFeed; 
    NSLog(@"objects: %@", latestFeed); //3
    [self.feedTableView reloadData];
    [SVProgressHUD dismiss];
}

This all works fine, im getting the data which is loaded in a background thread and my table is displaying the posts with all the detail required. The problem I have is that the SVProgressHUD is not showing at all. Even if I put the [SVProgressHUD showInView line in the fetchData method, it’s still not showing. (by the way i know the SVProgressHUD code works because I can actually make it show forexample in the viewWillAppear method.

Im guessing that it’s not working because at the point when I’m calling it the view does not yet fully exist? But if that’s the case where should I call it so that it shows whilst the feed is being called and where should I remove it?

Any help appreciated! thanks in advance!!

  • 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-11T00:47:00+00:00Added an answer on June 11, 2026 at 12:47 am

    For anyone else having a similar problem, this can also happen because you have a long loop or a piece of code that takes a long time to execute. If this happens, your progress bar wont be shown until after the loop, which kind of defeats the purpose.

    To solve this issue you need to you this:

    • (void)performSelectorInBackground:(SEL)aSelector withObject:(id)arg

    Basically your code would look something like this:

    - (IBAction)submitPost:(id)sender {
        //now we show the loading bar and submit the comment
        [SVProgressHUD showWithStatus:@"Submitting post" maskType:SVProgressHUDMaskTypeGradient];
        SEL aSelector = @selector(submitDataOfPost);
        [self performSelectorInBackground:aSelector withObject:sender];
    }
    

    This will basically load the progress bar, and in a background thread, the method you want to execute will be called. This makes sure that the UI is updated (shows the progress hud) at the same time that your code is executed.

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

Sidebar

Related Questions

I am developing an app for iOS 5, which have to run in landscape
We developing a iOS app that uses CoreData. To keep ourselves from going crazy
I have an iOS app which I am developing, this app has videos which
I am building an iOS App which displays video streams from a somewhat complex
I am currently developing my first iOS app which i have tested on simulator
I'm developing an iOS app using Core Plot headers. I have different UI for
I am developing an iOS app with a tab bar controller. In the first
I am developing an IOS app. I need a functionality that includes undo and
I am developing an iOS app that allows users to download documents off a
I am developing an iOS app that must handle several stereo audio files (ranging

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.