The key difference between +imageWithContentsOfFile:
and +imageNamed:
is the former always read the specified file from the filesystem for every call whereas the latter checks a system-maintained cache and only reads from the filesystem when it isn't available in the cache. So generally, you'd want to load images used in your UI with +imageNamed:
and use +imageWithContentsOfFile:
for images that are not repeatedly used within the app to improve the performance and memory footprint of your app.
Your feedback is valuable: Do you want more nuggets like this? Yes or No
.
.