Latest 1.0
Homepage https://github.com/silence0201/ArchiverEasy
License MIT
Platforms ios , requires ARC
Authors

更简单的使用NSKeyedUnarchiverNSKeyedArchiver

使用

import

ArchiverEasy文件夹拉入目录
手工导入

#import "NSKeyedArchiver+Key.h"
#import "NSKeyedUnarchiver+Key.h"

pod安装

pod 'ArchiverEasy', '~> 1.0'

Archiving

 // 默认存入沙盒Document/DefaultArchive文件夹中
[NSKeyedArchiver archiveRootObject:array forKey:@"kk"] ;

// 自定义文件夹路径
NSString *path = [NSHomeDirectory() stringByAppendingPathComponent:@"custom"] ;
[NSKeyedArchiver archiveRootObject:array forKey:@"kk" WithFolderPath:path] ;

Unarchiving

 // 从默认目录读取
NSArray *a1 = [NSKeyedUnarchiver unarchiveObjectForKey:@"kk"] ;

// 从指定目的读取
NSArray *a2 = [NSKeyedUnarchiver unarchiveObjectForKey:@"kk" WithPath:path] ;

ArchiverEasy

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

Latest podspec

{
    "name": "ArchiverEasy",
    "version": "1.0",
    "summary": "Easy Use NSKeyedUnarchiver And NSKeyedArchiver",
    "description": "iOS Category to Easy Use NSKeyedUnarchiver And NSKeyedArchiver",
    "homepage": "https://github.com/silence0201/ArchiverEasy",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "platforms": {
        "ios": null
    },
    "authors": {
        "Silence": "[email protected]"
    },
    "source": {
        "git": "https://github.com/silence0201/ArchiverEasy.git",
        "tag": "1.0"
    },
    "source_files": [
        "ArchiverEasy",
        "ArchiverEasy/*.{h,m}"
    ],
    "exclude_files": "ArchiverEasy/Exclude",
    "requires_arc": true,
    "public_header_files": "ArchiverEasy/*.h"
}

Pin It on Pinterest

Share This