Inheritance: NSObject
Example #1
0
        public static NSData FromFile(string path, NSDataReadingOptions mask, out NSError error)
        {
#if !XAMARIN
            path = Path.Combine(UnityEngine.Application.streamingAssetsPath, path);
#endif

            IntPtr errorHandle;
            var data = Runtime.GetNSObject<NSData>(ObjC.MessageSendIntPtr(_classHandle, Selector.GetHandle("dataWithContentsOfFile:options:error:"), path, (uint)mask, out errorHandle));
            error = errorHandle == IntPtr.Zero ? null : Runtime.GetNSObject<NSError>(errorHandle);
            return data;
        }
Example #2
0
 public static NSData FromUrl(string url, NSDataReadingOptions mask, out NSError error)
 {
     IntPtr errorHandle;
     var data = Runtime.GetNSObject<NSData>(ObjC.MessageSendIntPtr_NSUrl(_classHandle, Selector.GetHandle("dataWithContentsOfURL:options:error:"), url, (uint)mask, out errorHandle));
     error = errorHandle == IntPtr.Zero ? null : Runtime.GetNSObject<NSError>(errorHandle);
     return data;
 }