No Description

TBSDKPersistentStorage.h 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. //
  2. // PersistentStorage.h
  3. // mtopsdk
  4. //
  5. // Created by sihai on 19/5/15.
  6. // Copyright (c) 2015 mtop. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. @interface TBSDKPersistentStorage: NSObject
  10. /*!
  11. * 获取类似NSUserDefaults的standardUserDefaults, 该存储会被icloud备份和恢复
  12. *
  13. * @return
  14. * NSUserDefaults
  15. */
  16. + (NSUserDefaults*) standardStorage;
  17. /*!
  18. * 获取存储实例该存储不会被icloud备份和恢复
  19. * @return
  20. * NSUserDefaults子类
  21. */
  22. + (TBSDKPersistentStorage*) storageWithoutICloudBackup;
  23. /*!
  24. * 获取指定key的值
  25. * @param key
  26. * @return
  27. *
  28. */
  29. - (id) objectForKey:(NSString*) key;
  30. /*!
  31. * 获取指定key的值
  32. * @param key
  33. * @return
  34. *
  35. */
  36. - (id) valueForKey: (NSString*) key;
  37. /*!
  38. * 获取double值
  39. *
  40. */
  41. - (BOOL) boolForKey: (NSString*) key;
  42. /*!
  43. * 获取double值
  44. *
  45. */
  46. - (double) doubleForKey: (NSString*) key;
  47. /*!
  48. * 获取int值
  49. *
  50. */
  51. - (int) integerForKey: (NSString*) key;
  52. /*!
  53. * 获取long值
  54. *
  55. */
  56. - (long) longForKey: (NSString*) key;
  57. /*!
  58. * 获取long long值
  59. *
  60. */
  61. - (long long) longLongForKey: (NSString*) key;
  62. /*!
  63. * 设置指定key的值
  64. * @param value
  65. * @param key
  66. * @return
  67. *
  68. */
  69. - (void) setObject: (id) value forKey: (NSString*) key;
  70. /*!
  71. * 删除指定key的值
  72. * @param key
  73. *
  74. */
  75. - (void) removeObjectForKey: (NSString*) key;
  76. /*!
  77. * 刷新内存中的改动到磁盘
  78. * @param key
  79. *
  80. */
  81. - (void) flush;
  82. @end