Take the 2-minute tour ×

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?


    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];


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 *'

share|improve this question

1 Answer 1

up vote 3 down vote accepted

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];
share|improve this answer

Your Answer


