1

I am trying to setup MBProgressHUD on a project that uses storyboards, I am getting the errors below when ever I try to compile it. I then get no popup when I click on my button to call this. Any ideas on what i can do to fix this?

Code:

    HUD = self.navigationController.view;
    [self.navigationController.view addSubview:HUD];

    HUD.delegate = self;
    HUD.labelText = @"Loading";

    [HUD showWhileExecuting:@selector(myTask) onTarget:self withObject:nil animated:YES];

Errors:

DetailViewController.m:162:24:{162:24-162:28}: warning: passing 'DetailViewController *const __strong' to parameter of incompatible type 'id' [3]

DetailViewController.m: warning: Semantic Issue: Incompatible pointer types assigning to 'MBProgressHUD *__strong' from 'UIView *'

ios85
  • 2,104
  • 7
  • 37
  • 55

1 Answers1

4

I don't understand why you're assigning a UIView to (what I'm assuming is) an MBProgressHUD variable on the first line of your example. The following shows typical usage of MBProgressHUD—this works for me under ARC (referencing your previous question):

self.HUD = [[MBProgressHUD alloc] initWithView:self.navigationController.view];
[self.navigationController.view addSubview:self.HUD];
[self.HUD setDelegate:self];
[self.HUD setLabelText:@"Loading"];
[self.HUD showWhileExecuting:@selector(myTask) onTarget:self withObject:nil animated:YES];
Community
  • 1
  • 1