Latest 1.0
License MIT


  • NSObjectCoder is an efficient and delightful library for IOS and Mac OS X.

  • It automatically encodes and decodes all attributes of a NSObject instance.

  • Choose NSObjectCoder for your project, you will be happy you don’t need to write additional code for each attribute anymore:

    - (void)encodeWithCoder:(NSCoder *)aCoder;

    - (id)initWithCoder:(NSCoder*)aDecoder;


Version 1.0

How to use

  • Download NSObjectCoder and drag NSObjectCoder folder directly to your project.

  • For any class extending NSObject that you would like to encode and decode, import NSObjectCoder.h into your .h file:

    #import `NSObjectCoder.h`
  • Copy and paste the following code into .m file:

    For encode:

    - (void)encodeWithCoder:(NSCoder *)aCoder{
        [NSObjectCoder encodePropertiesOfObject:self ToCoder:aCoder];

    For decode:

    -(id)initWithCoder:(NSCoder *)aDecoder{
        if(self = [super init]){
            [NSObjectCoder decodePropertiesOfObject:self FromCoder:aDecoder];
        return self;
  • Enjoy now!

Installation with ‘CocoaPods’

CocoaPods is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries like NSObjectCoder in your projects.


platform :ios, '7.0'
pod "NSObjectCoder", "~> 1.0"


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

Latest podspec

    "name": "NSObjectCoder",
    "version": "1.0",
    "summary": "NSObjectCoder is an efficient library that automatically encodes and decodes all attributes of NSObject instance.",
    "homepage": "",
    "license": {
        "type": "MIT"
    "authors": {
        "Eric-LeiYang": "[email protected]"
    "source": {
        "git": "",
        "tag": "1.0"
    "source_files": "NSObjectCoder/NSObjectCoder/NSObjectCoder/NSObjectCoder.{h,m}",
    "requires_arc": true

Pin It on Pinterest

Share This