MBProgressHUD
をアプリケーション内で使用しようとしています。 HUDがビューに追加された時点でエラーが発生しています。MBProgressHUDを使用したアサーションエラー - ビューはnilであってはなりません。
これは、進行状況バーをビューに追加するコードです。
HUD = [[MBProgressHUD alloc] initWithView:self.navigationController.view];
[self.view.window addSubview:HUD];
// Set determinate mode
HUD.mode = MBProgressHUDModeAnnularDeterminate;
HUD.labelText = @"Loading";
// myProgressTask uses the HUD instance to update progress
[HUD showWhileExecuting:@selector(processFieldEntries) onTarget:self withObject:nil animated:YES];
アプリケーションエラーが発生した:
*** Assertion failure in -[MBProgressHUD initWithView:], /Users/.../MBProgressHUD/MBProgressHUD.m:190
また
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'View must not be nil.'
そして
Crash: View must not be nil.
誰もがアサーション障害がために、どのように解決するのが何であるかを知っています。 MBProgressHUD.mファイルは、ビルドフェーズタブのコンパイルソースとヘッダーに含まれています。進捗状況は、フィールド検証を処理するプロセスに追加されています。
ty。私はこの例ではnavControllerを使用していなかったので、ビューだけからinitを持つべきです。 – StuartM
+1、非常に良い答え... – AppStore