Path Parameter in UIImage imageWithContentsOfFile: for XCAsset

Viewed 3292

Is there any way to retrieve a UIImage object with imageWithContentsOfFile: if the image is stored in an Bundle (Xcode 5 Image Catalog)?

It's easy to access it with the imageNamed: method, but imageWithContentsOfFile: has a slightly different behavior, so what do I pass in the path parameter?

I've tried to use a variety of formats, but they all return a nil value:

  • ImageName@2x.png
  • ImageName@2x
  • ImageName
  • NSBundle File Path to Image

Apple's documentation doesn't specify a format for this. Any ideas?

1 Answers
Related