我正在尝试使用这里找到的MBProgressHUD,但我遇到了一个问题。
我希望能够在加载新UIViewController时显示UIView进度指示器
- (void)viewDidLoad {
HUD = [[MBProgressHUD alloc] initWithView:self.view.window];
}问题是视图还没有初始化并返回一个异常。
我该如何克服这个问题呢?
Teo
发布于 2010-12-19 23:14:03
伙计,你永远不会想要写这样的代码:
self.view.window //In iOS projects, *window* is such a holy thing that only the *AppDelegate is responsible to handle在MBProgressHUD的官方示例代码中,他们是这样编码的:
mbProgressHUD = [[MBProgressHUD alloc] initWithView:self.view];https://stackoverflow.com/questions/4483528
复制相似问题