Class NSDecodingFailurePolicy


  • public final class NSDecodingFailurePolicy
    extends java.lang.Object
    Describes the action an NSCoder should take when it encounters decode failures (e.g. corrupt data) for non-TopLevel decodes.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static long RaiseException
      On decode failure, the NSCoder will raise an exception internally to propagate failure messages (and unwind the stack).
      static long SetErrorAndReturn
      On decode failure, the NSCoder will capture the failure as an NSError, and prevent further decodes (by returning 0 / nil equivalent as appropriate).
    • Method Summary

      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • RaiseException

        public static final long RaiseException
        On decode failure, the NSCoder will raise an exception internally to propagate failure messages (and unwind the stack). This exception can be transformed into an NSError via any of the TopLevel decode APIs.
        See Also:
        Constant Field Values
      • SetErrorAndReturn

        public static final long SetErrorAndReturn
        On decode failure, the NSCoder will capture the failure as an NSError, and prevent further decodes (by returning 0 / nil equivalent as appropriate). Clients should consider using this policy if they know that all encoded objects behave correctly in the presence of decode failures (e.g. they use -failWithError: to communicate decode failures and don't raise exceptions for error propagation)
        See Also:
        Constant Field Values