Not sure how else to specify the path to the image.
I've added a png into a new image named "StatusBarIcon", which lives inside "Images.xcassets" resource folder.
I see they put a json file and what not.
Tried to do what the examples out there say, but no matter what I try, I always get nil as the output of [NSImage imageNamed:@"name of paths attempted here"]
Won't load using the full path either, I suppose the method is looking for the name of the image, but I've no idea how to specify the name correctly it seems, or perhaps I need another method?
Here are screenshots of my code, and my project.
Make sure you have the project set to use xcassets instead of just individual resource files. Once you create an image in the xcasset, you should just specify the name of the image, not the path. For example, [NSImage imageNamed:@"StatusBarIcon"]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With