ios - How do you build an NSURL for an image in Image.xcassets? -
the easiest way load local uiimage asset of course use +[uiimage imagenamed] case, want supply nsurl *. how nsurl * local file?
while using xcasset, xcode put files in new one. 1 file manage them all. so, can't access image store inside xcasset directly. apple's documentation:
for projects deployment target of @ least ios 7 or os x 10.9, xcode compiles asset catalogs runtime binary file format reduces download time app.
if have access file, have 2 choice:
- don't use xcasset image, put image normal image in project , use
nsbundleit - use
uiimage imagenamed, , save in directory of choice
but whatever need, should think way manage it. above solutions work, i'm sure can have nicer solution.
Comments
Post a Comment