Latest 1.3.5
Homepage https://github.com/CYHAI9/CyhCoredataManager
License MIT
Platforms ios
Authors

pod ‘CyhCoredataManager’

1.创建一个数据库,名字是创建的coredata的文件名字
[[cyhCoredtaDB coredataDBShare] createCoredataDB:@"coredataModel"];

2.添加数据

[cyhCoredtaDB inserDataWith_CoredatamodelClass:[DataModel class] CoredataModel:^(DataModel * model) {

    model.num = model01.num;
    model.name = model01.name;

} Error:^(NSError *error) {

   }];

3.查询数据

[cyhCoredtaDB selectDataWith_CoredatamoldeClass:[DataModel class] where:@"num = 100" Alldata_arr:^(NSArray *coredataModelArr) {

    [coredataModelArr enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
       DataModel * model = obj;
        NSLog(@"条件查询:%d==%@",model.num,model.name);
    }];

} Error:^(NSError *error) {

   }];

4.更改数据

[cyhCoredtaDB updataDataWith_CoredatamoldeClass:[DataModel class] where:@"num = 100" result:^(DataModel * model){

    model.num = 10;

} Error:^(NSError *error) {

  }];

5.删除数据

[cyhCoredtaDB deleteDataWith_CoredatamoldeClass:[DataModel class] where:@"num = 100" result:^(BOOL isResult) {

    NSLog(@"0失败1成功:%d",isResult);
} Error:^(NSError *error) {

}];

Latest podspec

{
    "name": "CyhCoreDataManager",
    "version": "1.3.5",
    "summary": "coredta for iOS",
    "homepage": "https://github.com/CYHAI9/CyhCoredataManager",
    "license": "MIT",
    "authors": {
        "u53c8u662fu4e00u4e2au5927u53d4": "[email protected]"
    },
    "platforms": {
        "ios": null
    },
    "source": {
        "git": "https://github.com/CYHAI9/CyhCoredataManager.git",
        "tag": "1.3.5"
    },
    "source_files": "CyhCoreDataManager/*.{h,m}",
    "public_header_files": "CyhCoreDataManager/*.h"
}

Pin It on Pinterest

Share This