Help with crash on iOS 14 only

I am getting a crash on our iOS app since iOS 14 hit the market. The same app build on previous versions of iOS have NOT had the crash.

It appears to be crashing on a background thread. I have looked for everything modifying the UI and cannot find any place we modify the UI in the background thread.

Any help with where to go next would be great.


Answered by kiwi131 in 653619022
I was able to track down the this issue. In a base class, we are setting the UINavigationBar items, one of which is an image. The image is based on an API request that was sent off to a background thread. It appears the image was also set in the background thread, although the UINavigationBar items set on the main thread.

Interestingly, the images load as expected upon load of the view, and the crash only happens after "some period" of time when a view was popped off the stack.

Reading crash logs still is a mystery to me, but somehow we stumbled across the cause.

TL;DR
Updating UINavigationBar items in a background thread caused the crash.

 I have looked for everything modifying the UI and cannot find any place we modify the UI in the background thread.

Many sort of issues may happen in multi-threaded contexts. You may need to check all thread-unsafe operations done in the background thread. Not only UI modification.


Does the crash appear to be caused by a thread-unsafe operation done in the background?
Accepted Answer
I was able to track down the this issue. In a base class, we are setting the UINavigationBar items, one of which is an image. The image is based on an API request that was sent off to a background thread. It appears the image was also set in the background thread, although the UINavigationBar items set on the main thread.

Interestingly, the images load as expected upon load of the view, and the crash only happens after "some period" of time when a view was popped off the stack.

Reading crash logs still is a mystery to me, but somehow we stumbled across the cause.

TL;DR
Updating UINavigationBar items in a background thread caused the crash.
Help with crash on iOS 14 only
 
 
Q