动画停止工作



我知道这听起来有点笼统,但这正是问题所在。在我的应用程序中漫游一段时间后,我所做的某些事情(不知道是什么)导致应用程序丢失所有动画。

动画,

如:键盘向上/向下弹出,视图控制器推送动画...甚至是我的编码动画。什么都没用。一切都会立即弹出/弹出。

我什至不确定我的哪个代码导致这种情况......

可能是我的代码中的错误?还是

我设备中的错误?还是iOS8中的错误?

谢谢

在后台队列中执行动画时,动画将停止工作。理想情况下,您将在代码中找到并修复此类实例。这里有一个库可以帮助追踪它们:

https://github.com/Cocoanetics/DTFoundation/blob/develop/Core/Source/iOS/Debug/UIView%2BDTDebug.m

这是让动画再次工作的好方法(来自应用开发人员论坛):

[UIView setAnimationsEnabled:YES]

好的...找到了。

我正在加载一个新的视图控制器。在视图中,我放置了一个块以查看该应用程序是否有权创建提醒。页面的加载在块完成后被推迟,这就是导致错误的原因。

这是我的错误代码:

- (void)viewDidLoad {
    [super viewDidLoad];
    self.shouldAlert = YES;
    [[EventStoreManager sharedManager] connectRemindersPermissionWithCompletion:^(BOOL granted) {
        if (granted) {
            [self initData];
            [self initGraphics];
            [self pageLoaded];
        } else {
            dispatch_async(dispatch_get_main_queue(), ^(void) {
                UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@""APP_NAME" Would Like to Access Your Reminders" message:@"Settings -> Privacy -> Reminders" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
                [alert showWithCompletion:^(UIAlertView *alertView, NSInteger buttonIndex) {
                    [self closeAddTaskButtonPressed:nil];
                }];
            });
        }
    }];
}

这是我的更正:

- (void)viewDidLoad {
    [super viewDidLoad];
    self.shouldAlert = YES;
    [self initData];
    [self initGraphics];
    [self pageLoaded];
    [[EventStoreManager sharedManager] connectRemindersPermissionWithCompletion:^(BOOL granted) {
        if (granted) {
        } else {
            dispatch_async(dispatch_get_main_queue(), ^(void) {
                UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@""APP_NAME" Would Like to Access Your Reminders" message:@"Settings -> Privacy -> Reminders" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
                [alert showWithCompletion:^(UIAlertView *alertView, NSInteger buttonIndex) {
                    [self closeAddTaskButtonPressed:nil];
                }];
            });
        }
    }];
}

错误已解决... :)

不太可能,但是:尝试在代码库中搜索"速度"。 万一你

[UIApplication sharedApplication].keyWindow.layer.speed = 99.0;

或类似的东西。

最新更新