Bundled image not found with NSBundle

So here is the deal: I have an image in the Resources folder of the user structure, which I use by default for classes within the framework. However, when I create these classes in projects that are related to my map, they do not say that they cannot find the image. I assume that NSBundle + mainBundle is not looking for the correct paths for my classes to find this image when connecting in another project. It's right? If so, where should I look for my image? Hope this makes sense (it's terribly late) and thanks for the help!

+3
source share
2 answers

For an application, + mainBundle will be a collection of applications (e.g. Foo.app). Frames are their own package, which you can find with + bundleForClass: or + bundleWithIdentifier :.

+2
source

Probably your image does not fall into the main set. You may need to use the NSBundle directly to create the path to your image. What does the built hierarchy of .app files look like in an image?

0
source

Source: https://habr.com/ru/post/1756680/


All Articles