Latest 1.4.1
Homepage https://github.com/lakesoft/LKCodingObject
License MIT
Platforms ios 10.0, requires ARC
Authors

Usage

Step 1 : Define subclass of LKCodingObject

#import "LKCodingObject.h"

@interface UserInfo : LKCodingObject
@property (strong, nonatomic) NSString* name;
@property (strong, nonatomic) NSString* email;
@end

Step 2 : Archive an instance of the class

UserInfo* userInfo = UserInfo.new;
userInfo.name = @"Hoge";
userInfo.email = @"[email protected]";
[NSKeyedArchiver archiveRootObject:userInfo toFile:@"user_info.dat"];

Step 3 : Unarchive from the file

UeserInfo* userInfo = [NSKeyedUnarchiver unarchiveObjectWithFile:@"user_info.dat"];

It is not necessary to implement NSCoding methods.

Notes

  • Properties must be conformed to NSCoding protocol.
  • If a property is not conforming to it, the property will not be archived.

Installation

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

pod "LKCodingObject"

Author

Hiroshi Hashiguchi, [email protected]

License

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

Latest podspec

{
    "name": "LKCodingObject",
    "version": "1.4.1",
    "summary": "NSCoding conformed library",
    "description": "Properties can be archived/unarchived with conforming to NSCoding.",
    "homepage": "https://github.com/lakesoft/LKCodingObject",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Hiroshi Hashiguchi": "[email protected]"
    },
    "source": {
        "git": "https://github.com/lakesoft/LKCodingObject.git",
        "tag": "1.4.1"
    },
    "platforms": {
        "ios": "10.0"
    },
    "requires_arc": true,
    "source_files": "Classes/*"
}

Pin It on Pinterest

Share This