0

私はUIAlertviewその 1 つのアクティビティ インジケーター内で使用しviewdidload() ています。しかし、遅延後にスーパービューから削除しようとしましたが、UIAlertview次のコードを使用して削除した後、アプリで何もできません。新しい透明なレイヤーがまだ私の上で実行されているようです。見る。

コード

 -(void)startAlertActivity
    {
        _alertView = [[UIAlertView alloc] initWithTitle:@"Loading "
                                                message:@"\n"
                                               delegate:self
                                      cancelButtonTitle:nil
                                      otherButtonTitles:nil];

        spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];

        spinner.center = CGPointMake(139.5, 75.5); // .5 so it doesn't blur
        [_alertView addSubview:spinner];

        [spinner startAnimating];
        [_alertView show];
        [_alertView performSelector:@selector(stopAlertActivity) withObject:self afterDelay:5.0];


    }

    -(void)stopAlertActivity
    {  [spinner stopAnimating];
        [_alertView dismissWithClickedButtonIndex:0 animated:YES];
    }

ITS はまだ画面上で実行されている透明なレイヤーのように見えます。どうすればそれを閉じることができますか?

例の画像.... ここに画像の説明を入力

私にとって、アラートは現在画面に表示されていませんが、背景は水色です

クラッシュレポート

[UIAlertView stopAlertActivity]: unrecognized selector sent to instance 0x9ab5eb0
2013-08-02 12:20:43.822 AssamKart[5719:12203] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIAlertView stopAlertActivity]: unrecognized selector sent to instance 0x9ab5eb0'
*** First throw call stack:
4

4 に答える 4

0

半透明の背景に添付されているため、スーパービューから削除するのではなく、アラート ビューを閉じる必要があります。stopAlertActivity遅れてから電話。

于 2013-08-02T06:43:14.830 に答える