uncommitted CATransaction

  • UILabel でテキストが更新されない時。

    [現象] サーバより非同期で取得したデータをLabelのテキストに入れたが きちんと更新が行われない。下記Warningがでる CoreAnimation: warning, deleted thread with uncommitted CATransaction [原因] 非同期で取得したためUIViewのanimationがメインスレッドで実行されないことが原因 [対策] メインスレッドで実行するように指定 [コード] //メインスレッドで実行 dispatch_async(dispatch_get_main_queue(), ^{ // Perform any drawing/UI updates here. self.currentBalance.text = [NSString stringWithFormat:@”%d”,(int) balance]; });

    続きを読む