I can't be correctly obtained the image form Asset.xcassets

Using the Xcode template to create a plug-in, I added an Asset.xcassets, then drag in the picture, but I use

NSImage * img = [NSImage imageNamed: @ "myimg"]; 

can’t get the image , nil is returned. Is Asset.xcassets what other settings do I need after it added?
The image I can be correctly obtained brought with I created app project in Xcode and the pictures I dragged in Asset.xcassets,this Asset.xcassets is generated automatically when the project is created.

The NSImage API accesses the resources of the main bundle. The main bundle is the one used by Glyphs the app. Your plugin is loaded from a separate bundle.

Use bundleForClass: and pass it the class of your plugin, for example: [YourPluginClassName class].

Then, use imageForResource: on that bundle.

It’s right!Thanks! :+1: