Latest 1.0.1
License MIT
Platforms ios 6.0, requires ARC

NSObject category to define a description method that automatically lists all properties of a specific instance.

Writing a complete description method can quickly become exhausting if your objects have lots of properties. Think of all the time you could use for more useful stuff on your projects if a description method could automatically describe all properties of your custom objects.

Installation with CocoaPods

CocoaPods is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries in your projects. You can install it by using the following command in your terminal:

sudo gem install cocoapods


pod 'NSObject-LNTXAutoDescription', '~> 1.0'

How to use it

The NSObject+LNTXAutoDescription category automatically defines a lntx_autoDescription method that does all you need.

Let say you have a Person class that defines a few properties:

@interface Person : NSObject

@property (nonatomic, copy) NSString *firstName;
@property (nonatomic, copy) NSString *lastName;
@property (nonatomic) NSInteger age;


You can now call lntx_autoDescription on an instance of that class:

Person *person = [[Person alloc] init];
person.firstName = @"Lenny";
person.lastName = @"Ticks";
person.age = 42;

NSLog(@"%@", [person lntx_autoDescription]);

This will produce the following output:

<Person: firstName=Lenny, lastName=Ticks, age=42>

You can also implement it in the standard description method:

#import "NSObject+LNTXAutoDescription"

@implementation Person

Calling description will now produce the same output as calling lntx_autoDescription.


This source code was originally created for LINITIX and its own iOS applications.


Follow LINITIX on Twitter (@linitix_).



This source code is available under the MIT license. See the LICENSE file for more info.


Any issue and pull request is welcome.

Latest podspec

    "name": "NSObject-LNTXAutoDescription",
    "version": "1.0.1",
    "summary": "NSObject category that let you define an automatic description method.",
    "description": "NSObject category to define a description method that automatically lists all properties of a specific instance.",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "Damien Rambout": "[email protected]"
    "platforms": {
        "ios": "6.0"
    "source": {
        "git": "",
        "tag": "1.0.1"
    "source_files": "NSObject+LNTXAutoDescription",
    "requires_arc": true

Pin It on Pinterest

Share This