Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ios8 UIImage imageNamed: crash

I am getting a strange crash listed in crashlytics for UIImage imageNamed: method. This crash appears only on iOS8 and is a persistent issue for many users. Although, strangely I have not been able to reproduce the issue while testing.

Please refer the image of crash log from crashlytics. enter image description here

I guess, this may have to do something with the internal working of imageNamed: method.

like image 575
Puneet Sharma Avatar asked Jan 06 '15 11:01

Puneet Sharma


1 Answers

The issue got resolved after I moved the UIImage imageNamed: method from background thread to main thread. Incidentally, this should always have given a run-time crash, because that method is supposed to run on main thread only(as all UIKit methods), but for some reason previous versions of iOS let it run. In iOS8 though it crashes more often, but not always.

like image 170
Puneet Sharma Avatar answered Sep 28 '22 04:09

Puneet Sharma