NSKeyedUnarchiver+YYAdd.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. //
  2. // NSKeyedUnarchiver+YYAdd.h
  3. // YYKit <https://github.com/ibireme/YYKit>
  4. //
  5. // Created by ibireme on 13/8/4.
  6. // Copyright (c) 2015 ibireme.
  7. //
  8. // This source code is licensed under the MIT-style license found in the
  9. // LICENSE file in the root directory of this source tree.
  10. //
  11. #import <Foundation/Foundation.h>
  12. NS_ASSUME_NONNULL_BEGIN
  13. /**
  14. Provides extensions for `NSKeyedUnarchiver`.
  15. */
  16. @interface NSKeyedUnarchiver (YYAdd)
  17. /**
  18. Same as unarchiveObjectWithData:, except it returns the exception by reference.
  19. @param data The data need unarchived.
  20. @param exception Pointer which will, upon return, if an exception occurred and
  21. said pointer is not NULL, point to said NSException.
  22. */
  23. + (nullable id)unarchiveObjectWithData:(NSData *)data
  24. exception:(NSException *_Nullable *_Nullable)exception;
  25. /**
  26. Same as unarchiveObjectWithFile:, except it returns the exception by reference.
  27. @param path The path of archived object file.
  28. @param exception Pointer which will, upon return, if an exception occurred and
  29. said pointer is not NULL, point to said NSException.
  30. */
  31. + (nullable id)unarchiveObjectWithFile:(NSString *)path
  32. exception:(NSException *_Nullable *_Nullable)exception;
  33. @end
  34. NS_ASSUME_NONNULL_END