Latest 1.0.1
Homepage https://github.com/cbangchen/CBModel
License MIT
Platforms ios 7.0, requires ARC
Dependencies FMDB
Authors

![Gitter](https://badges.gitter.im/Join Chat.svg)
MIT Licence
Open Source Love

FMDB encapsulation,Model storage,include Model Maker!

Installation with CocoaPods

CocoaPods is a dependency manager for Objective-C

Podfile

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '7.0'

pod 'CBModel', '~> 1.0.1'

Then, cd you directory and run the following command:

$ pod install

Table Manager

Clear Table
+ (BOOL)clearTable;

Save Methods

Save Single Object
- (BOOL)saveSingleObject;
Save Single Object Asynchronously
- (void)AsySaveSingleObjectsWithResultBlock:(CBAsyResultBlock)resultBock;
Save Objects With Arrary
+ (BOOL)saveObjectsWithArray:(NSArray *)array;
Save Objects With Arrary Asynchronously
+ (void)AsySaveObjectsWithArray:(NSArray *)array
                    resultBlock:(CBAsyResultBlock)resultBock;

Update Methods

Update Single Object
- (BOOL)updateSingleObject;
Update Single Object Asynchronously
- (void)AsyUpdateSingleObjectsWithResultBlock:(CBAsyResultBlock)resultBock;
Update Objects With Array
+ (BOOL)updateObjectsWithArray:(NSArray *)array;
Update Objects With Array Asynchronously
+ (void)AsyUpdateObjectsWithArray:(NSArray *)array
                      resultBlock:(CBAsyResultBlock)resultBock;

Delete Methods

Delete Single Object
- (BOOL)deleteSingleObject;
Delete Single Object Asynchronously
- (void)AsyDeleteSingleObjectsWithResultBlock:(CBAsyResultBlock)resultBock;
Delete Objects With Array
+ (BOOL)deleteObjectsWithArray:(NSArray *)array;
Delete Objects With Array Asynchronously
+ (void)AsyDeleteObjectsWithArray:(NSArray *)array
                      resultBlock:(CBAsyResultBlock)resultBock;
Delete Objects With Criteria
+ (BOOL)deleteObjectsWithCriteria:(NSString *)criteria;
Delete Objects With Muti Criterias
+ (BOOL)deleteObjectsWithFormat:(NSString *)format, ...;

Find Methods

Find All Objects
+ (NSArray *)findAllObjects;
Find Objects With Criteria
+ (NSArray *)findByCriteria:(NSString *)criteria;
Find Objects With Muti Criterias
+ (NSArray *)findWithFormat:(NSString *)format, ...;

Make The Model

Dictionary -> Model
- (void)configurePropertyWithDictionary:(NSDictionary *)dictionary;
Dictionary Include Model Object -> Model
- (NSArray *)configurePropertyWithArray:(NSArray *)array;
Model -> Dictionary
- (NSDictionary *)makeDictionary;

Latest podspec

{
    "name": "CBModel",
    "version": "1.0.1",
    "summary": "u5bf9u4e8eFMDBu7684u5c01u88c5,u9488u5bf9Modelu5c42u7684u76f4u63a5u5b58u50a8uff0cu5305u542bJSON<->Modleu8f6cu6362.",
    "homepage": "https://github.com/cbangchen/CBModel",
    "license": "MIT",
    "authors": {
        "u9648u8d85u90a6": "http://cbang.info"
    },
    "source": {
        "git": "https://github.com/cbangchen/CBModel.git",
        "commit": "e325da35dc95115b2dbcb484d4389cd4a2b08f58"
    },
    "platforms": {
        "ios": "7.0"
    },
    "requires_arc": true,
    "dependencies": {
        "FMDB": []
    }
}

Pin It on Pinterest

Share This