0

部分的なカールを使用しているときにアクションを停止および開始するにはどうすればよいですか? viewWillDisappear関数を試してみましたviewWillAppearが、現在のView Controllerで機能を試しましたが、settingsViewControllerに切り替えて戻ったときに呼び出されないようでした。

私も私の中でこれを試しましたfirst VC

    TwistmAppDelegate *AppDelegate = [[UIApplication sharedApplication] delegate];
    AppDelegate.timer = [NSTimer scheduledTimerWithTimeInterval:30.0
                                     target:self
                                   selector:@selector(resetSpin:)
                                   userInfo:nil
                                    repeats:YES];

そしてこれは私のsecond VC

TwistmAppDelegate *AppDelegate = [[UIApplication sharedApplication] delegate];
[AppDelegate.timer invalidate];

しかし、これもうまくいかないようです。

4

0 に答える 0