1

MBProgressHUD には次のメソッドがあります。

 [progressHUD performSelector:@selector(hide:) 
                   withObject:[NSNumber numberWithBool:YES] 
                   afterDelay:kMessageHidingDelay];

ここでの遅延は 2.0 ですが、2.0 秒後に hide を呼び出していません。非表示機能にブレークポイントを設定しようとしましたが、そこに到達しません。何か案が?完全なコードは次のとおりです。

progressHUD = [[MBProgressHUD alloc] initWithView:viewToAttach];

            // Add HUD to screen
            [viewToAttach addSubview:progressHUD];
            progressHUD.labelText = @"Logging In";
            progressHUD.removeFromSuperViewOnHide = YES;
            // Show the HUD while the provided method executes in a new thread

            [progressHUD show:YES];
4

3 に答える 3

0

メインスレッドでセレクターを実行しようとする可能性があります(すべてのUI変更はメインスレッドで実行する必要があります)? performSelectorOnMainThread:

于 2012-01-10T22:06:22.023 に答える