Plist as database.
注意事項
- Not thread safe.
- 只接受 plist 可儲存的格式:
- NSString
- NSNumber
- NSArray
- NSDictionary
- NSDate
- NSData
使用 Carthage 安裝.
+ (nullable NSArray <NSDictionary *> *)plist:(NSString *)name
queryWhere:(nullable NSPredicate *)where
orderBy:(nullable NSArray <NSSortDescriptor *> *)orders;
其中
- name: plist 名稱.
- where: 過濾條件.
- orders: 排序條件.
當 where == nil
時, 將返回全部查詢.
+ (BOOL)plist:(NSString *)name insert:(NSArray <NSDictionary *> *)dics;
其中
- name: plist 名稱.
- dics: 要新增的資料, 單筆或多筆.
+ (BOOL)plist:(NSString *)name update:(NSDictionary *)dic where:(NSPredicate *)where;
其中
- name: plist 名稱.
- dic: 要修改的資料.
- where: 過濾條件.
當 where 不成立
將返回修改失敗.
+ (BOOL)plist:(NSString *)name removeWhere:(NSPredicate *)where;
其中
- name: plist 名稱.
- where: 過濾條件.
當 where 不成立
將返回刪除失敗.
+ (BOOL)dropPlist:(NSString *)name;
其中
- name: plsit 名稱.
可用來刪除全部資料.