AutoDescribe 1.0.0

AutoDescribe 1.0.0

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Dec 2014

Maintained by Unclaimed.


Downloads

Total6,710
Week0
Month28

Installs

Apps27
Test Targets8
powered by Segment

GitHub

Stars123
Watchers7
Forks13
Issues0
Contributors3
Pull Requests1

Code

Files2
LOCLines of Code 51


  • By
  • Simon Strandgaard

Prints human-readable information about an instance.

The problem

You pretty print objects using NSLog(@"firstName: %@ lastName:%@ age: %@", ...). It takes forever to write NSLog. Classes evolves and the properties changes. NSLog's are rarely in sync with the properties.

Solution

AutoDescribe is like PHP's var_dump and print_r. All properties are pretty printed.

Sample code

#import <AutoDescribe/NSObject+AutoDescribe.h>

// A class with some properties
@interface TestPerson : NSObject
@property (nonatomic, strong) NSString *firstName;
@property (nonatomic, strong) NSString *lastName;
@property (nonatomic, strong) NSNumber *age;
@end

@implementation TestPerson
// empty
@end

// Create instance of class and invoke autoDescribe
TestPerson *person = [TestPerson new];
person.firstName = @"John";
person.lastName = @"Doe";
person.age = [NSNumber numberWithFloat:33.33];
NSLog(@"%@", [person autoDescribe]);

Output from sample code

firstName=John
lastName=Doe
age=33.3

Podfile

If your want the latest version, then add this to your Podfile

pod 'AutoDescribe', :git => 'https://github.com/neoneye/autodescribe.git'

Contact

Simon Strandgaard

License

This code is distributed under the terms and conditions of the MIT license.

Change-log

Version 1.0.0 @ 06.04.2013

  • Full cocoapods support.