Hi, everyone. In my project’s images.xcassets, I created three image sets with these names:
Folder SinglePage MultiPage Each one contains a single PNG image. Now I’m trying to load them into NSImages. Here’s what doesn’t work: let folderImage: NSImage let singleDocumentImage: NSImage let multiDocumentImage: NSImage override init() { // Swift requires local properties to be initialized first theProject = DocumentNode.CreateSampleProject() folderImage = Document.getImageAsset( "Folder" ) singleDocumentImage = Document.getImageAsset( "SingleDocument" ) multiDocumentImage = Document.getImageAsset( "MultiDocument" ) super.init() } class func getImageAsset( name: String ) -> NSImage { let bundle = NSBundle.mainBundle() let imageFileName = bundle.pathForResource( name, ofType: "png" ) let img = NSImage( contentsOfFile: imageFileName ) return img } After calling bundle.pathForResource:ofType:, imageName is nil. I think what I’m doing is what the Resource Programming Guide says to do. How am I getting it wrong? -- Charles Jenkins _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com