Skip to content

Instantly share code, notes, and snippets.

@pa-w
Created August 7, 2014 00:59
Show Gist options
  • Save pa-w/62b69a237270190303ed to your computer and use it in GitHub Desktop.
Save pa-w/62b69a237270190303ed to your computer and use it in GitHub Desktop.
public static NSUrl URLForResource (this NSBundle source, string for_resource, string with_extension) {
var ns_for = new NSString(for_resource);
var ns_extension = new NSString(with_extension);
//try and get the resource
var result = Messaging.IntPtr_objc_msgSend_IntPtr_IntPtr(
source.Handle,
NSBundleExtensions._Selector_URLForResource,
ns_for.Handle,
ns_extension.Handle);
//return back as a NSUrl
return Runtime.GetNSObject(result) as NSUrl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment