Exemplo n.º 1
0
        /// <summary>
        /// </summary>
        /// <param name="key"></param>
        /// <returns>val</returns>
        public byte[] BufferForKey(
            string key)
        {
            IntPtr source       = IntPtr.Zero;
            IntPtr exceptionPtr = IntPtr.Zero;
            long   length       = 0;

            NSUbiquitousKeyValueStore_bufferForKey(
                Handle,
                key,
                ref source,
                ref length,
                ref exceptionPtr);

            if (exceptionPtr != IntPtr.Zero)
            {
                var nativeException = new NSException(exceptionPtr);
                throw new CloudKitException(nativeException, nativeException.Reason);
            }

            byte[] bytes = new byte[length];
            Marshal.Copy(source, bytes, 0, (int)length);
            return(bytes);
        }
Exemplo n.º 2
0
 public CloudKitException(NSException nativeException, string message) : base(message)
 {
     NSException = nativeException;
 }