アプリの起動時にパスコード/ピンコード(モーダルビューコントローラ)を表示しようとしています。あなたはAppDelegate.hにコードが表示されることがありますアプリを起動するとパスコード/ピンコードが表示される - ストーリーボード
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
if (![[NSUserDefaults standardUserDefaults] boolForKey:@"passcode_in"]) {
//display passcode screen
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
UIViewController *vc = [storyboard instantiateViewControllerWithIdentifier:@"PasscodeViewController"];
[vc setModalPresentationStyle:UIModalPresentationFullScreen];
[self presentModalViewController:vc animated:NO];
} else {
NSLog(@"No Passcode Screen");
}
return YES;
}
問題はAppDelegateがモーダルビューコントローラ(presentModalViewController)を表示するためにサポートしていないということです。私は.xibファイルを使用するつもりはない、私のアプリのStoryboardのみ。誰がそれが間違っているか知っていますか?任意の提案が高く評価されました。
が、私は私の以前の投稿の質問のいずれかに与えられた指示に従っ
を解決しhttps://stackoverflow.com/a/10303870/1344459私は(PinCodeViewControllerためAppDelegate.mに二つの方法にapplicationDidEnterBackgroundとapplicationWillTerminateをいくつかのコードを追加することで問題を解決しましたモーダル)を起動します。今はとてもスムーズに作業しています。
明確にするために、カスタムセグを介してこのログイン画面を表示するViewControllerは、最初のView Controllerである必要があります。 – geraldWilliam
これは私の他のUIViewControllerのための本当に良いものですが、ログインとPinCodeスクリーンではありません。私はアプリケーションを起動すると、PinDecodeViewController(モーダル)のAppDelegate.mの** applicationDidEnterBackground **と** applicationWillTerminate **の2つのメソッドにいくつかのコードを追加しました。今はとてもスムーズに作業しています。ご協力ありがとうございました。 – hightech