Skip to content

把OC的对象直接插入数据库,从数据库中读取OC对象

License

Notifications You must be signed in to change notification settings

SCSHICHUAN/SCDB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SCDB

CI Status Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

SCDB is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'SCDB'

Start

As long as three steps:

1.Create table

2.Insert models

3.Read object

Example


    /*SCDB Example*/
    
    Model *model = [[Model alloc] init];
    model.name = @"石川";
    model.age = 30;
    NSArray *array;
        

    //1. creat a table for this model 
   [SCdb CreateTableWithClass:[Model class]];
        
   //2. insert oc object to table
   [SCdb insertModes:@[model]];
                         
   //3. read oc object in table
   array = [SCdb selectClass:[Model class] andProperty:@"name" andWhere:Nil];
        
        
    for (Model *model in array) {
        NSLog(@"[name:%@,heigit:%ld]",model.name,(long)model.age);
    }


If you want see the API run,downlod this poriect and run 'Tests'

Author

scshichuan, [email protected]

License

SCDB is available under the MIT license. See the LICENSE file for more info.

About

把OC的对象直接插入数据库,从数据库中读取OC对象

Resources

License

Stars

Watchers

Forks

Packages