UIImage(contentsOfFile:) returning nil despite file existing in caches directory
More about “UIImage(contentsOfFile:) returning nil despite file existing in caches directory” related questions

UIImage set image withfile in caches directory

I am getting nil image when i try to set image from local file path (Caches directory) file:///...... NSString* localImagePath=@"file:///Users/mac/Library/Application%20Support/iPhone%20Simulator/...

Show Detail

Memory Problems with UIImage(contentsOfFile)

I have a Collection View where i load some Images from my documents directory: func reloadNotesFromStore() { { let fetchRequest = NSFetchRequest(entityName: "TaskDraw") let

Show Detail

UIImage using contentsOfFile

I am using self.imageView.image = UIImage(named: "foo.png") to select and load images in an UIIMageView. I have the images in my app under the images.xcassets. The problem is that this particular...

Show Detail

Loading file from Directory to UIIMAGE doesnt work

So i'm downloading an image using DownloadTask , and than save the image in the Cache Directory with name for my own uses : let fileManager = NSFileManager.defaultManager() let doc...

Show Detail

Not able to create files in caches directory

I'm trying to set up a caches directory for use in my app, but the files are not being created for a reason unknown to me. What am I doing wrong? Here are the methods I'm using: In class Utilities...

Show Detail

UIImage imageNamed returning nil

UIImage imageNamed returning nil in xcode 6 on iphone 6 simulator.. but perfectly works on xcode 5 code: UIImage *img=[UIImage imageNamed@"img@2x~ipad"];

Show Detail

Getting asset catalog path for image using UIImage(contentsOfFile:)

When you drag an image from the desktop into the asset catalog in Xcode, you can access that image in a project using: UIImage(named: "somePNG") But how do you access that image using UIImage(

Show Detail

UIImage returns nil but exists

I have a problem in Swift. I try to load an image which is stored in the DocumentsDirectory but it returns nil. Here is the code: if NSFileManager.defaultManager().fileExistsAtPath(url!.path!) { ...

Show Detail

can't get UIImage's init(contentsOfFile:) to work

I am trying to locate a file in a subdirectory of subdirectory of my bundle. I used this code to create an UIImage with init(contentsOfFile:). let resource = NSBundle.mainBundle().pathForResource(...

Show Detail

How can I use UIImage(contentsOfFile:String) with image data downloaded from the internet?

I have an app which is loading a lot of image data from a web server. The data is being saved onto the ipad via: func saveParsedObject(objectToSave:AnyObject,dataCode:Int) { var path:S...

Show Detail