##CoreArchive
.Xcode 5.0, iOS 6.0
.OC,Swift
.Under the MIT License
.MJExtension
#import "CoreArchive.h"
//Save Double
[CoreArchive setDouble:12.7 key:@"level"];
//Get Double
double level = [CoreArchive doubleForKey:@"level"];
//remove
[CoreArchive removeDoubleForKey:@"level"];
Above is a static method call, it's simple. Let's look at a custom object archiving, the same burst table is so simple!
First you have to customize an object, I am here as a user model as an example, to create a UserModel
@interface UserModel : NSObject
@property (nonatomic,copy) NSString *name;
@property (nonatomic,assign) NSUInteger age;
import framework
#import "CoreArchive.h"
Then add the .h and .m each add a macro:
.h add CoreArchiver_MODEL_H
.m add CoreArchiver_MODEL_M
.h add CoreArchiiver_MODEL_H ![image](./CoreArchive/1.png)
UserModel *userModel = [[UserModel alloc] init];
userModel.name = @"Charlin";
userModel.age = 27;
A key archive custom objects: key: The default pass nil for the framework automatically calculate key, you can also customize key
//One Key Archive
BOOL res = [UserModel saveSingleModel:userModel forKey:@"charlin"];
#### One Key UnArchive Custom Model: //One Key UnArchive UserModel *userModel =[UserModel readSingleModelForKey];
#### One Key Remove Custom Model : //Remove [UserModel save:nil forKey:@"charlin"];
#### Archive Custom Objects: Array. key: The default pass nil for the frame automatically calculate key, you can also customize key
#### A key custom object array Archive: //array Archive BOOL res = [UserModel saveListModel:@[userModel1,userModel2,...] forKey:nil];
#### A key custom object array UnArchive: //UnArchive NSArray *listModel = [UserModel readListModelForKey];
#### Remove Archive of Array: //Remove [UserModel saveListModel:nil forKey:nil];
#import "CoreArchive+Version.h"
Use the following three methods, you can easily manage your version number:
/** Save current version information */
+(void)saveCurrentVersionInfo;
/** Whether the local current version has already been saved */
+(BOOL)isSavedCurrentVersionInfo;
/** The current version number of the program: The system version number, the local version number of non-filing */
+(NSString *)currentVersion;
Well, it is simple, you do not need to be concerned about the overall process key, path these, the framework has already done.
key: The default pass nil for the frame automatically calculate key, you can also customize key. Of course, you want to be consistent access key.
WebSite:http://ios-android.cn
Sina WeiBo:http://weibo.com/charlin2015/
One:CoreFMDB https://github.com/nsdictionary/CoreFMDB
Two:CoreArchive https://github.com/nsdictionary/CoreArchive
Three:CoreModel https://github.com/nsdictionary/CoreClass