1

Here is my code under viewDidLoad method of a single ViewController as a child of my PageViewController.

- (void)viewDidLoad {

    [super viewDidLoad];

    [KVNProgress showWithStatus:@"Loading"]; // Not shown on child vc, see attached screen shot

    [[DataManager sharedInstance]getWeatherReportForPlace:@"Kolkata" completionBLock:^(WeatherReport *report, NSError *error) {

        [KVNProgress showSuccessWithStatus:@"Success"];

    }];
}

If I add [KVNProgress showWithStatus:@"Loading"]; inside completionBlock then it's working but it is only showing success.

But I want a Loading until the completion Block finish it's execution.For that I need to put the [KVNProgress showWithStatus:@"Loading"]; outside completionBlock.

Here is my scenario

enter image description here

Sauvik Dolui
  • 5,520
  • 3
  • 34
  • 44
Sajib Ghosh
  • 410
  • 1
  • 6
  • 17
  • why are you doing all of this on viewDidLoad? Can't you separate this logic in a separate method and try the same. – Satheesh Dec 28 '15 at 07:59
  • 1
    The main problem what I could suspect for now is you are not doing stuff in proper threads, on what thread does the DataManager class execute? – Satheesh Dec 28 '15 at 08:04
  • 1
    Thanks @satheeshwaran, finally embedding `[KVNProgress showWithStatus:@"Loading"];` in main thread with `dispatch_async(dispatch_get_main_queue(), ^(void){ //Run UI Updates [KVNProgress showWithStatus:@"Loading"]; });` solved the problem. – Sajib Ghosh Dec 28 '15 at 08:43

0 Answers0