Get the absolute path of a ressource in MacRuby
Let say we have a "menubar-icon.png" under /Resources in our macruby application and we want the absolute path of that file in order to do something with it.
Here is how to do it:
absolute_path = NSBundle.mainBundle.pathForResource("menubar-icon", ofType:"png")
Written by Gregory
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Macruby
Authors
Related Tags
#macruby
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#