Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
public static class NSLogHelper
{
[DllImport ("/System/Library/Frameworks/Foundation.framework/Foundation")]
extern static void NSLog (IntPtr format, [MarshalAs (UnmanagedType.LPStr)] string s);
public static void NSLog (string format, params object[] args)
{
var fmt = NSString.CreateNative ("%s");
var val = (args == null || args.Length == 0) ? format : string.Format (format, args);
NSLog (fmt, val);
NSString.ReleaseNative (fmt);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.