Created
July 7, 2016 14:25
-
-
Save chamons/e2e409013a449cfbe1f2fbe5547f6554 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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