maria
maria

Reputation: 71

Could not load the “” image referenced from a nib in the bundle with identifier

When I put my images in the playingwithcontainerviews folder, they show up on my app. When I put my images in my imagesofcuteanimals folder, they don't. I have targets selected for the folder. This is the error: Could not load the “” image referenced from a nib in the bundle with identifier.

image of where the pictures of cute animals are located

Upvotes: 0

Views: 1112

Answers (1)

Shehata Gamal
Shehata Gamal

Reputation: 100503

The blue folder is reference type when you load the image access it like this

let img = UIImage(named:"folderName/imageName.jpeg")

OR

if let img = Bundle.main.path(forResource:"imageName",ofType:"jpeg",
 inDirectory:"folderName") { }

Upvotes: 1

Related Questions