2016-05-04 4 views
0

いくつかのことを確認しながら、私のAppDelegateに読み込みメッセージを表示したいとき、そしてこのタスクを完了し、デリゲートを使って結果を得るとき、このメッセージを閉じます。AppDelegateのローディングメッセージを表示する

どうすればいいですか?私はこのソリューションを実装しますが、アラートを却下することはできません。

ここで私は、アラートを起動:あまりにAppdelegateでここ

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 

    _alert_news = [[UIAlertView alloc]initWithTitle:@"" message: @"telo" delegate:nil cancelButtonTitle:nil otherButtonTitles:nil, nil]; 
    [_alert_news show]; 

    return YES; 
} 

を、私は私の応答を受け取る:

#pragma mark InitializeDelegate 
-(void)checkState:(NSString*)State{ 

    NSLog(@"InitializeResult: %@",State); 
    [_alert_news dismissWithClickedButtonIndex:0 animated:YES]; 

} 

おかげFIXED

!! 最後に、この問題を次のように修正しました。

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 

    _alert= [UIAlertController 
       alertControllerWithTitle:@"" 
       message:@"Loading GradiantFace ..." 
       preferredStyle:UIAlertControllerStyleAlert]; 


    [self.window makeKeyAndVisible]; 
    [self.window.rootViewController presentViewController:_alert animated:YES completion:nil]; 


    return YES; 
} 

#pragma mark InitializeDelegate 
-(void)checkState:(NSString*)State{ 

    NSLog(@"InitializeResult: %@",State); 
    dispatch_async(dispatch_get_main_queue(), ^{ 
     [self.window.rootViewController dismissViewControllerAnimated:YES completion:nil]; 
    }); 


} 
+0

ボタンがありません。そして、UIAlertControllerを見てください。私はそれをatmにリンクすることはできません。私はモバイルです – chronikum

+0

他の処理が進行している間に進捗ビューを使用する方が良い –

+0

行1を_alert_news = [[UIAlertView alloc] initWithTitle:@ " @ "telo"デリゲート:nil cancelButtonTitle:@ "OK" otherButtonTitles:nil、nil]; – Rahul

答えて

2

これは実行しないでください。代わりに、最初のView Controllerをブランクコントローラとして作成します。そこでは、物をロードしてからホームビューコントローラに置き換えるときに、ローダ(またはメッセージ)を表示する必要があります。

関連する問題