├── Example
├── NSObject-AutoDescription.xcodeproj
│ ├── project.xcworkspace
│ │ └── contents.xcworkspacedata
│ └── project.pbxproj
├── NSObject-AutoDescription-Mac
│ ├── NSObject-AutoDescription-Mac-Prefix.pch
│ ├── NAAppDelegate_Mac.h
│ ├── NSApplicationSupport.h
│ ├── main.m
│ ├── NAAppDelegate_Mac.m
│ ├── NSApplicationSupport.m
│ └── NSObject_AutoDescription_Mac.1
├── NSObject-AutoDescription
│ ├── NASuperUser.m
│ ├── NASuperUser.h
│ ├── NAMain.h
│ ├── NAUser.m
│ ├── NAGroup.h
│ ├── NAGroup.m
│ ├── NAUser.h
│ └── NAMain.m
└── NSObject-AutoDescription-iOS
│ ├── NAAppDelegate_iOS.h
│ ├── NSObject-AutoDescription-Prefix.pch
│ ├── main.m
│ ├── NAAppDelegate_iOS.m
│ └── NSObject-AutoDescription-Info.plist
├── .gitignore
├── NSObject+AutoDescription
├── NSObject+AutoDescription.h
├── NSObject+CleanDescription.h
├── NSObject+AutoDescription.m
└── NSObject+CleanDescription.m
├── NSObject+AutoDescription.podspec
├── LICENSE
└── README.md
/Example/NSObject-AutoDescription.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Example/NSObject-AutoDescription-Mac/NSObject-AutoDescription-Mac-Prefix.pch:
--------------------------------------------------------------------------------
1 | //
2 | // Prefix header for all source files of the 'NSObject-AutoDescription-Mac' target in the 'NSObject-AutoDescription-Mac' project
3 | //
4 |
5 | #ifdef __OBJC__
6 | #import
7 | #endif
8 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Xcode
2 | .DS_Store
3 | */build/*
4 | *.pbxuser
5 | !default.pbxuser
6 | *.mode1v3
7 | !default.mode1v3
8 | *.mode2v3
9 | !default.mode2v3
10 | *.perspectivev3
11 | !default.perspectivev3
12 | xcuserdata
13 | profile
14 | *.moved-aside
15 | DerivedData
16 | .idea/
17 | *.hmap
18 |
--------------------------------------------------------------------------------
/Example/NSObject-AutoDescription/NASuperUser.m:
--------------------------------------------------------------------------------
1 | //
2 | // NASuperUser.m
3 | // NSObject-AutoDescription
4 | //
5 | // Created by Alexey Aleshkov on 09.05.13.
6 | // Copyright (c) 2013 Alexey Aleshkov. All rights reserved.
7 | //
8 |
9 |
10 | #import "NASuperUser.h"
11 |
12 |
13 | @implementation NASuperUser
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/Example/NSObject-AutoDescription-Mac/NAAppDelegate_Mac.h:
--------------------------------------------------------------------------------
1 | //
2 | // NAAppDelegate_Mac.h
3 | // NSObject-AutoDescription
4 | //
5 | // Created by Alexey Aleshkov on 04.08.13.
6 | // Copyright (c) 2013 Alexey Aleshkov. All rights reserved.
7 | //
8 |
9 |
10 | #import
11 |
12 |
13 | @interface NAAppDelegate_Mac : NSObject
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/Example/NSObject-AutoDescription/NASuperUser.h:
--------------------------------------------------------------------------------
1 | //
2 | // NASuperUser.h
3 | // NSObject-AutoDescription
4 | //
5 | // Created by Alexey Aleshkov on 09.05.13.
6 | // Copyright (c) 2013 Alexey Aleshkov. All rights reserved.
7 | //
8 |
9 |
10 | #import "NAUser.h"
11 |
12 |
13 | @interface NASuperUser : NAUser
14 |
15 | @property (nonatomic, strong) NSSet *scope;
16 |
17 | @end
18 |
--------------------------------------------------------------------------------
/Example/NSObject-AutoDescription/NAMain.h:
--------------------------------------------------------------------------------
1 | //
2 | // NAMain.h
3 | // NSObject-AutoDescription
4 | //
5 | // Created by Alexey Aleshkov on 04.08.13.
6 | // Copyright (c) 2013 Alexey Aleshkov. All rights reserved.
7 | //
8 |
9 |
10 | #import
11 | #import "NAUser.h"
12 | #import "NASuperUser.h"
13 | #import "NAGroup.h"
14 |
15 |
16 | @interface NAMain : NSObject
17 |
18 | + (void)main;
19 |
20 | @end
21 |
--------------------------------------------------------------------------------
/Example/NSObject-AutoDescription-Mac/NSApplicationSupport.h:
--------------------------------------------------------------------------------
1 | //
2 | // NSApplicationSupport.h
3 | // NSObject-AutoDescription
4 | //
5 | // Created by Alexey Aleshkov on 04.08.13.
6 | // Copyright (c) 2013 Alexey Aleshkov. All rights reserved.
7 | //
8 |
9 |
10 | #import
11 |
12 |
13 | APPKIT_EXTERN int NSApplicationMainExt(int argc, const char *argv[], NSString *principalClassName, NSString *delegateClassName);
14 |
--------------------------------------------------------------------------------
/Example/NSObject-AutoDescription-iOS/NAAppDelegate_iOS.h:
--------------------------------------------------------------------------------
1 | //
2 | // NAAppDelegate_iOS.h
3 | // NSObject-AutoDescription
4 | //
5 | // Created by Alexey Aleshkov on 08.05.13.
6 | // Copyright (c) 2013 Alexey Aleshkov. All rights reserved.
7 | //
8 |
9 |
10 | #import
11 |
12 |
13 | @interface NAAppDelegate_iOS : UIResponder
14 |
15 | @property (strong, nonatomic) UIWindow *window;
16 |
17 | @end
18 |
--------------------------------------------------------------------------------
/Example/NSObject-AutoDescription-iOS/NSObject-AutoDescription-Prefix.pch:
--------------------------------------------------------------------------------
1 | //
2 | // Prefix header for all source files of the 'NSObject-AutoDescription' target in the 'NSObject-AutoDescription' project
3 | //
4 |
5 | #import
6 |
7 | #ifndef __IPHONE_3_0
8 | #warning "This project uses features only available in iOS SDK 3.0 and later."
9 | #endif
10 |
11 | #ifdef __OBJC__
12 | #import
13 | #import
14 | #endif
15 |
--------------------------------------------------------------------------------
/Example/NSObject-AutoDescription-iOS/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // NSObject-AutoDescription
4 | //
5 | // Created by Alexey Aleshkov on 08.05.13.
6 | // Copyright (c) 2013 Alexey Aleshkov. All rights reserved.
7 | //
8 |
9 |
10 | #import
11 | #import "NAAppDelegate_iOS.h"
12 |
13 |
14 | int main(int argc, char *argv[])
15 | {
16 | @autoreleasepool {
17 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([NAAppDelegate_iOS class]));
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/NSObject+AutoDescription/NSObject+AutoDescription.h:
--------------------------------------------------------------------------------
1 | //
2 | // NSObject+AutoDescription.h
3 | // NSObject-AutoDescription
4 | //
5 | // Created by Alexey Aleshkov on 09.05.13.
6 | // Copyright (c) 2013 Alexey Aleshkov. All rights reserved.
7 | //
8 | // Email: mailto:djmadcat@gmail.com
9 | // Github: https://github.com/djmadcat
10 | //
11 |
12 |
13 | #import
14 |
15 |
16 | @interface NSObject (AutoDescription)
17 |
18 | - (NSString *)autoDescription;
19 |
20 | @end
21 |
--------------------------------------------------------------------------------
/Example/NSObject-AutoDescription-Mac/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // NSObject-AutoDescription-Mac
4 | //
5 | // Created by Alexey Aleshkov on 04.08.13.
6 | // Copyright (c) 2013 Alexey Aleshkov. All rights reserved.
7 | //
8 |
9 |
10 | #import "NSApplicationSupport.h"
11 | #import "NAAppDelegate_Mac.h"
12 |
13 |
14 | int main(int argc, const char * argv[])
15 | {
16 | @autoreleasepool {
17 | return NSApplicationMainExt(argc, argv, nil, NSStringFromClass([NAAppDelegate_Mac class]));
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Example/NSObject-AutoDescription/NAUser.m:
--------------------------------------------------------------------------------
1 | //
2 | // NAUser.m
3 | // NSObject-AutoDescription
4 | //
5 | // Created by Alexey Aleshkov on 09.05.13.
6 | // Copyright (c) 2013 Alexey Aleshkov. All rights reserved.
7 | //
8 |
9 |
10 | #import "NAUser.h"
11 | #import "NSObject+AutoDescription.h"
12 |
13 |
14 | @implementation NAUser
15 |
16 | + (instancetype)user
17 | {
18 | return [[self alloc] init];
19 | }
20 |
21 | - (NSString *)description
22 | {
23 | return [self autoDescription];
24 | }
25 |
26 | @end
27 |
--------------------------------------------------------------------------------
/Example/NSObject-AutoDescription/NAGroup.h:
--------------------------------------------------------------------------------
1 | //
2 | // NAGroup.h
3 | // NSObject-AutoDescription
4 | //
5 | // Created by Alexey Aleshkov on 09.05.13.
6 | // Copyright (c) 2013 Alexey Aleshkov. All rights reserved.
7 | //
8 |
9 |
10 | #import
11 |
12 |
13 | @interface NAGroup : NSObject
14 |
15 | + (instancetype)group;
16 |
17 | @property (nonatomic, strong) NSNumber *groupID;
18 | @property (nonatomic, copy) NSString *name;
19 | @property (nonatomic, strong) NSSet *users;
20 |
21 | @end
22 |
--------------------------------------------------------------------------------
/Example/NSObject-AutoDescription/NAGroup.m:
--------------------------------------------------------------------------------
1 | //
2 | // NAGroup.m
3 | // NSObject-AutoDescription
4 | //
5 | // Created by Alexey Aleshkov on 09.05.13.
6 | // Copyright (c) 2013 Alexey Aleshkov. All rights reserved.
7 | //
8 |
9 |
10 | #import "NAGroup.h"
11 | #import "NSObject+AutoDescription.h"
12 |
13 |
14 | @implementation NAGroup
15 |
16 | + (instancetype)group
17 | {
18 | return [[self alloc] init];
19 | }
20 |
21 | - (NSString *)description
22 | {
23 | return [self autoDescription];
24 | }
25 |
26 | @end
27 |
--------------------------------------------------------------------------------
/Example/NSObject-AutoDescription-Mac/NAAppDelegate_Mac.m:
--------------------------------------------------------------------------------
1 | //
2 | // NAAppDelegate_Mac.m
3 | // NSObject-AutoDescription
4 | //
5 | // Created by Alexey Aleshkov on 04.08.13.
6 | // Copyright (c) 2013 Alexey Aleshkov. All rights reserved.
7 | //
8 |
9 |
10 | #import "NAAppDelegate_Mac.h"
11 | #import "NAMain.h"
12 |
13 |
14 | @implementation NAAppDelegate_Mac
15 |
16 | - (void)applicationDidFinishLaunching:(NSNotification *)notification
17 | {
18 | [NAMain main];
19 |
20 | [[NSApplication sharedApplication] terminate:self];
21 | }
22 |
23 | @end
24 |
--------------------------------------------------------------------------------
/NSObject+AutoDescription.podspec:
--------------------------------------------------------------------------------
1 | Pod::Spec.new do |s|
2 | s.name = 'NSObject+AutoDescription'
3 | s.version = '0.1'
4 | s.author = { 'Alexey Aleshkov' => 'djmadcat@gmail.com' }
5 | s.license = { :type => 'BSD', :file => 'LICENSE' }
6 | s.homepage = 'https://github.com/djmadcat/NSObject-AutoDescription'
7 | s.summary = 'NSObject+AutoDescription is an category that greatly simplifies the process of writing description method for data models.'
8 | s.source = { :git => 'https://github.com/djmadcat/NSObject-AutoDescription.git', :tag => s.version.to_s }
9 |
10 | s.requires_arc = true
11 |
12 | s.source_files = 'NSObject+AutoDescription/*.{h,m}'
13 |
14 | s.ios.deployment_target = '5.0'
15 | s.osx.deployment_target = '10.6'
16 | end
17 |
--------------------------------------------------------------------------------
/Example/NSObject-AutoDescription/NAUser.h:
--------------------------------------------------------------------------------
1 | //
2 | // NAUser.h
3 | // NSObject-AutoDescription
4 | //
5 | // Created by Alexey Aleshkov on 09.05.13.
6 | // Copyright (c) 2013 Alexey Aleshkov. All rights reserved.
7 | //
8 |
9 |
10 | #import
11 |
12 |
13 | @interface NAUser : NSObject
14 |
15 | + (instancetype)user;
16 |
17 | @property (nonatomic, strong) NSNumber *userID;
18 | @property (nonatomic, copy) NSString *login;
19 | @property (nonatomic, copy) NSString *firstName;
20 | @property (nonatomic, copy) NSString *lastName;
21 | @property (nonatomic, copy) NSString *email;
22 | @property (nonatomic, strong) NSDictionary *connections;
23 | @property (nonatomic, strong) NSSet *groups;
24 | @property (nonatomic, strong) NAUser *manager;
25 |
26 | @end
27 |
--------------------------------------------------------------------------------
/Example/NSObject-AutoDescription-iOS/NAAppDelegate_iOS.m:
--------------------------------------------------------------------------------
1 | //
2 | // NAAppDelegate_iOS.m
3 | // NSObject-AutoDescription
4 | //
5 | // Created by Alexey Aleshkov on 08.05.13.
6 | // Copyright (c) 2013 Alexey Aleshkov. All rights reserved.
7 | //
8 |
9 |
10 | #import "NAAppDelegate_iOS.h"
11 | #import "NAMain.h"
12 |
13 |
14 | @implementation NAAppDelegate_iOS
15 |
16 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
17 | {
18 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
19 | // Override point for customization after application launch.
20 | self.window.backgroundColor = [UIColor whiteColor];
21 | [self.window makeKeyAndVisible];
22 |
23 | [NAMain main];
24 |
25 | return YES;
26 | }
27 |
28 | @end
29 |
--------------------------------------------------------------------------------
/NSObject+AutoDescription/NSObject+CleanDescription.h:
--------------------------------------------------------------------------------
1 | //
2 | // NSObject+CleanDescription.h
3 | // NSObject-AutoDescription
4 | //
5 | // Created by Alexey Aleshkov on 09.05.13.
6 | // Copyright (c) 2013 Alexey Aleshkov. All rights reserved.
7 | //
8 | // Email: mailto:djmadcat@gmail.com
9 | // Github: https://github.com/djmadcat
10 | //
11 |
12 |
13 | #import
14 |
15 |
16 | @interface NSObject (CleanDescription)
17 |
18 | - (NSString *)cleanDescription;
19 |
20 | @end
21 |
22 |
23 | @interface NSString (CleanDescription)
24 |
25 | - (NSString *)cleanDescription;
26 |
27 | @end
28 |
29 |
30 | @interface NSArray (CleanDescription)
31 |
32 | - (NSString *)cleanDescription;
33 |
34 | @end
35 |
36 |
37 | @interface NSSet (CleanDescription)
38 |
39 | - (NSString *)cleanDescription;
40 |
41 | @end
42 |
43 |
44 | @interface NSDictionary (CleanDescription)
45 |
46 | - (NSString *)cleanDescription;
47 |
48 | @end
49 |
--------------------------------------------------------------------------------
/Example/NSObject-AutoDescription-iOS/NSObject-AutoDescription-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | ${PRODUCT_NAME}
9 | CFBundleExecutable
10 | ${EXECUTABLE_NAME}
11 | CFBundleIdentifier
12 | me.djmadcat.${PRODUCT_NAME:rfc1034identifier}
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | ${PRODUCT_NAME}
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 1.0
25 | LSRequiresIPhoneOS
26 |
27 | UIRequiredDeviceCapabilities
28 |
29 | armv7
30 |
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2013,
2 | Alexey Aleshkov
3 | All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions are met:
7 |
8 | 1. Redistributions of source code must retain the above copyright notice, this
9 | list of conditions and the following disclaimer.
10 | 2. Redistributions in binary form must reproduce the above copyright notice,
11 | this list of conditions and the following disclaimer in the documentation
12 | and/or other materials provided with the distribution.
13 |
14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
18 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
20 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
21 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
22 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 |
--------------------------------------------------------------------------------
/Example/NSObject-AutoDescription/NAMain.m:
--------------------------------------------------------------------------------
1 | //
2 | // NAMain.m
3 | // NSObject-AutoDescription
4 | //
5 | // Created by Alexey Aleshkov on 04.08.13.
6 | // Copyright (c) 2013 Alexey Aleshkov. All rights reserved.
7 | //
8 |
9 |
10 | #import "NAMain.h"
11 |
12 |
13 | @implementation NAMain
14 |
15 | + (void)main
16 | {
17 | NAUser *user = [NAUser user];
18 | user.userID = @16;
19 | user.firstName = @"Hans";
20 | user.lastName = @"Schneider";
21 | user.login = @"user333";
22 | user.email = @"h.schneider@datas.com";
23 |
24 | NASuperUser *superUser = [NASuperUser user];
25 | superUser.userID = @12;
26 | superUser.firstName = @"Super";
27 | superUser.lastName = @"User";
28 | superUser.login = @"admin";
29 | superUser.email = @"admin@localhost";
30 | superUser.scope = [NSSet setWithArray:@[@"post.add", @"post.edit", @"post.delete", @[@"123", @"123"]]];
31 | superUser.connections = @{@"twitter":@"someadmin", @"facebook":@"someadmin", @"other":@{@"another_social_network":@"someadmin"}};
32 | superUser.manager = superUser;
33 |
34 | NAGroup *group = [NAGroup group];
35 | group.groupID = @22;
36 | group.name = @"admins";
37 | group.users = [NSSet setWithArray:@[user, superUser]];
38 |
39 | user.groups = [NSSet setWithArray:@[group]];
40 | superUser.groups = [NSSet setWithArray:@[group]];
41 |
42 | NSLog(@"NASuperUser instance description: %@", superUser);
43 |
44 | NSLog(@"nil is %@", nil);
45 | NSLog(@"NSNull is %@", [NSNull null]);
46 | NSLog(@"Recursive self for enclosed context is (self)");
47 | }
48 |
49 | @end
50 |
--------------------------------------------------------------------------------
/Example/NSObject-AutoDescription-Mac/NSApplicationSupport.m:
--------------------------------------------------------------------------------
1 | //
2 | // NSApplicationSupport.m
3 | // NSObject-AutoDescription
4 | //
5 | // Created by Alexey Aleshkov on 04.08.13.
6 | // Copyright (c) 2013 Alexey Aleshkov. All rights reserved.
7 | //
8 |
9 |
10 | #import "NSApplicationSupport.h"
11 |
12 |
13 | int NSApplicationMainExt(int argc, const char *argv[], NSString *principalClassName, NSString *delegateClassName)
14 | {
15 | Class principalClass = nil;
16 | Class delegateClass = nil;
17 |
18 | NSBundle *mainBundle = [NSBundle mainBundle];
19 | NSDictionary *infoDictionary = [mainBundle infoDictionary];
20 |
21 | if (![principalClassName length]) {
22 | principalClassName = [infoDictionary objectForKey:@"NSPrincipalClass"];
23 | }
24 | if ([principalClassName length]) {
25 | principalClass = NSClassFromString(principalClassName);
26 | } else {
27 | principalClass = [NSApplication class];
28 | }
29 |
30 | if ([delegateClassName length]) {
31 | delegateClass = NSClassFromString(delegateClassName);
32 | }
33 |
34 | NSCAssert([principalClass respondsToSelector:@selector(sharedApplication)],
35 | @"Principal class must implement sharedApplication.");
36 | NSApplication *application = [principalClass sharedApplication];
37 |
38 | id delegate = [[delegateClass alloc] init];
39 | [application setDelegate:delegate];
40 |
41 | NSString *mainNibName = [infoDictionary objectForKey:@"NSMainNibFile"];
42 | NSNib *mainNib = [[NSNib alloc] initWithNibNamed:mainNibName bundle:mainBundle];
43 | [mainNib instantiateNibWithOwner:application topLevelObjects:nil];
44 |
45 | [application run];
46 |
47 | return 0;
48 | }
49 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # NSObject-AutoDescription
2 |
3 | NSObject+AutoDescription is an category that greatly simplifies the process of writing `description` method for data models.
4 |
5 | ## Overview
6 |
7 | `- (NSString *)description` method provide information about receiver instance. By default this method prints the object name and its address in memory. It looks like `` and... pretty useless.
8 | If you have a lot of classes-models in project, overloading `description` method for each class is very difficult and dreary. This category is based on reflection. By getting properties names and values it provides information about receiver in standard manner.
9 |
10 | ## NSArray, NSDictionary and NSSet description problem
11 |
12 | NSArray, NSDictionary and NSSet by default provides human-readable description. But there is one small problem: it contains newline symbols and white spaces. If we use default description for NSArray, NSDictionary or NSSet in user defined class description we get `\n`, `\t`, `\"`, and `\\` symbols. It looks ugly. For a clear description of these "erroneous" classes there is `CleanDescription` category. These categories emulate standard descriptions, but without special characters.
13 |
14 | ## Example usage
15 |
16 | ``` objective-c
17 | #import "NAUser.h"
18 | #import "NSObject+AutoDescription.h"
19 |
20 | @implementation NAUser
21 |
22 | - (NSString *)description
23 | {
24 | return [self autoDescription];
25 | }
26 |
27 | @end
28 | ```
29 |
30 | ## Read more
31 |
32 | - http://stackoverflow.com/questions/7521683/nsdictionary-description-formatting-problem-treats-structure-like-char-data
33 | - http://atkit.com/dev/objective-c/auto-description-category-nsobject-object/
34 | - http://iosdevelopertips.com/cocoa/overriding-nsobject-description-method.html
35 |
36 | ## Contact
37 |
38 | Alexey Aleshkov
39 |
40 | - https://github.com/djmadcat
41 | - https://twitter.com/coreshock
42 | - djmadcat@gmail.com
43 |
44 | ## License
45 |
46 | NSObject-AutoDescription is available under the BSD 2-Clause license. See the `LICENSE` file for more info.
47 |
--------------------------------------------------------------------------------
/NSObject+AutoDescription/NSObject+AutoDescription.m:
--------------------------------------------------------------------------------
1 | //
2 | // NSObject+AutoDescription.m
3 | // NSObject-AutoDescription
4 | //
5 | // Created by Alexey Aleshkov on 09.05.13.
6 | // Copyright (c) 2013 Alexey Aleshkov. All rights reserved.
7 | //
8 | // Email: mailto:djmadcat@gmail.com
9 | // Github: https://github.com/djmadcat
10 | //
11 |
12 |
13 | #import "NSObject+AutoDescription.h"
14 | #import
15 | #import "NSObject+CleanDescription.h"
16 |
17 |
18 | @implementation NSObject (AutoDescription)
19 |
20 | - (NSString *)autoDescription
21 | {
22 | return [NSString stringWithFormat:@"<%@: %p; %@>", NSStringFromClass([self class]), self, [self keyValueAutoDescription]];
23 | }
24 |
25 | - (NSString *)keyValueAutoDescription
26 | {
27 | NSMutableString *result = [NSMutableString string];
28 |
29 | dispatch_queue_t currentQueue = dispatch_get_current_queue();
30 |
31 | id associatedObject = objc_getAssociatedObject(self, currentQueue);
32 | if (associatedObject) {
33 | return @"(self)";
34 | }
35 |
36 | objc_setAssociatedObject(self, currentQueue, result, OBJC_ASSOCIATION_RETAIN);
37 |
38 | Class currentClass = [self class];
39 | while (currentClass != [NSObject class]) {
40 | unsigned int propertyListCount = 0;
41 | objc_property_t *propertyList = class_copyPropertyList(currentClass, &propertyListCount);
42 | for (int i = 0; i < propertyListCount; i++) {
43 | const char *property_name = property_getName(propertyList[i]);
44 | NSString *propertyName = [NSString stringWithCString:property_name encoding:NSASCIIStringEncoding];
45 |
46 | if (propertyName) {
47 | id propertyValue = [self valueForKey:propertyName];
48 | [result appendFormat:@"%@ = %@; ", propertyName, [propertyValue cleanDescription]];
49 | }
50 | }
51 | free(propertyList);
52 | currentClass = class_getSuperclass(currentClass);
53 | }
54 | NSUInteger length = [result length];
55 | if (length) {
56 | [result deleteCharactersInRange:NSMakeRange(length - 1, 1)];
57 | }
58 |
59 | objc_setAssociatedObject(self, currentQueue, nil, OBJC_ASSOCIATION_RETAIN);
60 |
61 | return result;
62 | }
63 |
64 | @end
65 |
--------------------------------------------------------------------------------
/NSObject+AutoDescription/NSObject+CleanDescription.m:
--------------------------------------------------------------------------------
1 | //
2 | // NSObject+CleanDescription.m
3 | // NSObject-AutoDescription
4 | //
5 | // Created by Alexey Aleshkov on 09.05.13.
6 | // Copyright (c) 2013 Alexey Aleshkov. All rights reserved.
7 | //
8 | // Email: mailto:djmadcat@gmail.com
9 | // Github: https://github.com/djmadcat
10 | //
11 |
12 |
13 | #import "NSObject+CleanDescription.h"
14 |
15 |
16 | @implementation NSObject (CleanDescription)
17 |
18 | - (NSString *)cleanDescription
19 | {
20 | NSString *result;
21 | result = [self description];
22 | return result;
23 | }
24 |
25 | @end
26 |
27 |
28 | @implementation NSString (CleanDescription)
29 |
30 | - (NSString *)cleanDescription
31 | {
32 | NSString *result;
33 |
34 | if ([self rangeOfCharacterFromSet:[[NSCharacterSet alphanumericCharacterSet] invertedSet]].location == NSNotFound) {
35 | result = self;
36 | } else {
37 | result = [NSString stringWithFormat:@"\"%@\"", self];
38 | }
39 |
40 | return result;
41 | }
42 |
43 | @end
44 |
45 |
46 | @implementation NSArray (CleanDescription)
47 |
48 | - (NSString *)cleanDescription
49 | {
50 | NSString *result;
51 |
52 | NSMutableString *elements = [NSMutableString string];
53 | for (id value in self) {
54 | [elements appendFormat:@"%@, ", [value cleanDescription]];
55 | }
56 | NSUInteger length = [elements length];
57 | if (length > 2) {
58 | [elements deleteCharactersInRange:NSMakeRange(length - 2, 2)];
59 | }
60 |
61 | result = [NSString stringWithFormat:@"(%@)", elements];
62 |
63 | return result;
64 | }
65 |
66 | @end
67 |
68 |
69 | @implementation NSSet (CleanDescription)
70 |
71 | - (NSString *)cleanDescription
72 | {
73 | NSString *result;
74 |
75 | result = [NSString stringWithFormat:@"{%@}", [[self allObjects] cleanDescription]];
76 |
77 | return result;
78 | }
79 |
80 | @end
81 |
82 |
83 | @implementation NSDictionary (CleanDescription)
84 |
85 | - (NSString *)cleanDescription
86 | {
87 | NSString *result;
88 |
89 | NSMutableString *elements = [NSMutableString string];
90 | for (id key in self) {
91 | id value = [self objectForKey:key];
92 | [elements appendFormat:@"%@ = %@; ", [key cleanDescription], [value cleanDescription]];
93 | }
94 | NSUInteger length = [elements length];
95 | if (length) {
96 | [elements deleteCharactersInRange:NSMakeRange(length - 1, 1)];
97 | }
98 |
99 | result = [NSString stringWithFormat:@"{%@}", elements];
100 |
101 | return result;
102 | }
103 |
104 | @end
105 |
--------------------------------------------------------------------------------
/Example/NSObject-AutoDescription-Mac/NSObject_AutoDescription_Mac.1:
--------------------------------------------------------------------------------
1 | .\"Modified from man(1) of FreeBSD, the NetBSD mdoc.template, and mdoc.samples.
2 | .\"See Also:
3 | .\"man mdoc.samples for a complete listing of options
4 | .\"man mdoc for the short list of editing options
5 | .\"/usr/share/misc/mdoc.template
6 | .Dd 04.08.13 \" DATE
7 | .Dt NSObject-AutoDescription-Mac 1 \" Program name and manual section number
8 | .Os Darwin
9 | .Sh NAME \" Section Header - required - don't modify
10 | .Nm NSObject-AutoDescription-Mac,
11 | .\" The following lines are read in generating the apropos(man -k) database. Use only key
12 | .\" words here as the database is built based on the words here and in the .ND line.
13 | .Nm Other_name_for_same_program(),
14 | .Nm Yet another name for the same program.
15 | .\" Use .Nm macro to designate other names for the documented program.
16 | .Nd This line parsed for whatis database.
17 | .Sh SYNOPSIS \" Section Header - required - don't modify
18 | .Nm
19 | .Op Fl abcd \" [-abcd]
20 | .Op Fl a Ar path \" [-a path]
21 | .Op Ar file \" [file]
22 | .Op Ar \" [file ...]
23 | .Ar arg0 \" Underlined argument - use .Ar anywhere to underline
24 | arg2 ... \" Arguments
25 | .Sh DESCRIPTION \" Section Header - required - don't modify
26 | Use the .Nm macro to refer to your program throughout the man page like such:
27 | .Nm
28 | Underlining is accomplished with the .Ar macro like this:
29 | .Ar underlined text .
30 | .Pp \" Inserts a space
31 | A list of items with descriptions:
32 | .Bl -tag -width -indent \" Begins a tagged list
33 | .It item a \" Each item preceded by .It macro
34 | Description of item a
35 | .It item b
36 | Description of item b
37 | .El \" Ends the list
38 | .Pp
39 | A list of flags and their descriptions:
40 | .Bl -tag -width -indent \" Differs from above in tag removed
41 | .It Fl a \"-a flag as a list item
42 | Description of -a flag
43 | .It Fl b
44 | Description of -b flag
45 | .El \" Ends the list
46 | .Pp
47 | .\" .Sh ENVIRONMENT \" May not be needed
48 | .\" .Bl -tag -width "ENV_VAR_1" -indent \" ENV_VAR_1 is width of the string ENV_VAR_1
49 | .\" .It Ev ENV_VAR_1
50 | .\" Description of ENV_VAR_1
51 | .\" .It Ev ENV_VAR_2
52 | .\" Description of ENV_VAR_2
53 | .\" .El
54 | .Sh FILES \" File used or created by the topic of the man page
55 | .Bl -tag -width "/Users/joeuser/Library/really_long_file_name" -compact
56 | .It Pa /usr/share/file_name
57 | FILE_1 description
58 | .It Pa /Users/joeuser/Library/really_long_file_name
59 | FILE_2 description
60 | .El \" Ends the list
61 | .\" .Sh DIAGNOSTICS \" May not be needed
62 | .\" .Bl -diag
63 | .\" .It Diagnostic Tag
64 | .\" Diagnostic informtion here.
65 | .\" .It Diagnostic Tag
66 | .\" Diagnostic informtion here.
67 | .\" .El
68 | .Sh SEE ALSO
69 | .\" List links in ascending order by section, alphabetically within a section.
70 | .\" Please do not reference files that do not exist without filing a bug report
71 | .Xr a 1 ,
72 | .Xr b 1 ,
73 | .Xr c 1 ,
74 | .Xr a 2 ,
75 | .Xr b 2 ,
76 | .Xr a 3 ,
77 | .Xr b 3
78 | .\" .Sh BUGS \" Document known, unremedied bugs
79 | .\" .Sh HISTORY \" Document history if command behaves in a unique manner
--------------------------------------------------------------------------------
/Example/NSObject-AutoDescription.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 27BD809A173ADE1600FFDF85 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 27BD8099173ADE1600FFDF85 /* UIKit.framework */; };
11 | 27BD809C173ADE1600FFDF85 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 27BD809B173ADE1600FFDF85 /* Foundation.framework */; };
12 | 27BD809E173ADE1600FFDF85 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 27BD809D173ADE1600FFDF85 /* CoreGraphics.framework */; };
13 | 27BD80A6173ADE1600FFDF85 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 27BD80A5173ADE1600FFDF85 /* main.m */; };
14 | 27BD80AA173ADE1600FFDF85 /* NAAppDelegate_iOS.m in Sources */ = {isa = PBXBuildFile; fileRef = 27BD80A9173ADE1600FFDF85 /* NAAppDelegate_iOS.m */; };
15 | 27BD80B9173ADEE500FFDF85 /* NSObject+AutoDescription.m in Sources */ = {isa = PBXBuildFile; fileRef = 27BD80B8173ADEE500FFDF85 /* NSObject+AutoDescription.m */; };
16 | 27BD80C2173AE10E00FFDF85 /* NAUser.m in Sources */ = {isa = PBXBuildFile; fileRef = 27BD80C1173AE10E00FFDF85 /* NAUser.m */; };
17 | 27BD80C6173AE31200FFDF85 /* NASuperUser.m in Sources */ = {isa = PBXBuildFile; fileRef = 27BD80C5173AE31200FFDF85 /* NASuperUser.m */; };
18 | 27BD80C9173B03EA00FFDF85 /* NAGroup.m in Sources */ = {isa = PBXBuildFile; fileRef = 27BD80C8173B03EA00FFDF85 /* NAGroup.m */; };
19 | 27BD80D0173B102B00FFDF85 /* NSObject+CleanDescription.m in Sources */ = {isa = PBXBuildFile; fileRef = 27BD80CF173B102B00FFDF85 /* NSObject+CleanDescription.m */; };
20 | 27D8CA8017AED367000E42EF /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 27BD809B173ADE1600FFDF85 /* Foundation.framework */; };
21 | 27D8CA8317AED367000E42EF /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 27D8CA8217AED367000E42EF /* main.m */; };
22 | 27D8CA8C17AED3CF000E42EF /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 27D8CA8B17AED3CF000E42EF /* AppKit.framework */; };
23 | 27D8CA9017AED737000E42EF /* NSApplicationSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 27D8CA8F17AED736000E42EF /* NSApplicationSupport.m */; };
24 | 27D8CA9117AEE393000E42EF /* NAUser.m in Sources */ = {isa = PBXBuildFile; fileRef = 27BD80C1173AE10E00FFDF85 /* NAUser.m */; };
25 | 27D8CA9217AEE393000E42EF /* NASuperUser.m in Sources */ = {isa = PBXBuildFile; fileRef = 27BD80C5173AE31200FFDF85 /* NASuperUser.m */; };
26 | 27D8CA9317AEE393000E42EF /* NAGroup.m in Sources */ = {isa = PBXBuildFile; fileRef = 27BD80C8173B03EA00FFDF85 /* NAGroup.m */; };
27 | 27D8CA9617AEE463000E42EF /* NAMain.m in Sources */ = {isa = PBXBuildFile; fileRef = 27D8CA9517AEE463000E42EF /* NAMain.m */; };
28 | 27D8CA9917AEE6A3000E42EF /* NAAppDelegate_Mac.m in Sources */ = {isa = PBXBuildFile; fileRef = 27D8CA9817AEE6A3000E42EF /* NAAppDelegate_Mac.m */; };
29 | 27D8CA9A17AEE6FE000E42EF /* NAMain.m in Sources */ = {isa = PBXBuildFile; fileRef = 27D8CA9517AEE463000E42EF /* NAMain.m */; };
30 | 27D8CA9E17AEE9BA000E42EF /* NSObject+CleanDescription.m in Sources */ = {isa = PBXBuildFile; fileRef = 27BD80CF173B102B00FFDF85 /* NSObject+CleanDescription.m */; };
31 | 27D8CA9F17AEE9BB000E42EF /* NSObject+AutoDescription.m in Sources */ = {isa = PBXBuildFile; fileRef = 27BD80B8173ADEE500FFDF85 /* NSObject+AutoDescription.m */; };
32 | /* End PBXBuildFile section */
33 |
34 | /* Begin PBXFileReference section */
35 | 27BD8096173ADE1600FFDF85 /* NSObject-AutoDescription-iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "NSObject-AutoDescription-iOS.app"; sourceTree = BUILT_PRODUCTS_DIR; };
36 | 27BD8099173ADE1600FFDF85 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
37 | 27BD809B173ADE1600FFDF85 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
38 | 27BD809D173ADE1600FFDF85 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
39 | 27BD80A1173ADE1600FFDF85 /* NSObject-AutoDescription-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "NSObject-AutoDescription-Info.plist"; sourceTree = ""; };
40 | 27BD80A5173ADE1600FFDF85 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
41 | 27BD80A7173ADE1600FFDF85 /* NSObject-AutoDescription-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSObject-AutoDescription-Prefix.pch"; sourceTree = ""; };
42 | 27BD80A8173ADE1600FFDF85 /* NAAppDelegate_iOS.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NAAppDelegate_iOS.h; sourceTree = ""; };
43 | 27BD80A9173ADE1600FFDF85 /* NAAppDelegate_iOS.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NAAppDelegate_iOS.m; sourceTree = ""; };
44 | 27BD80B7173ADEE500FFDF85 /* NSObject+AutoDescription.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSObject+AutoDescription.h"; sourceTree = ""; };
45 | 27BD80B8173ADEE500FFDF85 /* NSObject+AutoDescription.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSObject+AutoDescription.m"; sourceTree = ""; };
46 | 27BD80C0173AE10E00FFDF85 /* NAUser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NAUser.h; sourceTree = ""; };
47 | 27BD80C1173AE10E00FFDF85 /* NAUser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NAUser.m; sourceTree = ""; };
48 | 27BD80C4173AE31200FFDF85 /* NASuperUser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NASuperUser.h; sourceTree = ""; };
49 | 27BD80C5173AE31200FFDF85 /* NASuperUser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NASuperUser.m; sourceTree = ""; };
50 | 27BD80C7173B03EA00FFDF85 /* NAGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NAGroup.h; sourceTree = ""; };
51 | 27BD80C8173B03EA00FFDF85 /* NAGroup.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NAGroup.m; sourceTree = ""; };
52 | 27BD80CE173B102B00FFDF85 /* NSObject+CleanDescription.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSObject+CleanDescription.h"; sourceTree = ""; };
53 | 27BD80CF173B102B00FFDF85 /* NSObject+CleanDescription.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSObject+CleanDescription.m"; sourceTree = ""; };
54 | 27D8CA7F17AED366000E42EF /* NSObject-AutoDescription-Mac */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "NSObject-AutoDescription-Mac"; sourceTree = BUILT_PRODUCTS_DIR; };
55 | 27D8CA8217AED367000E42EF /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
56 | 27D8CA8517AED367000E42EF /* NSObject-AutoDescription-Mac-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSObject-AutoDescription-Mac-Prefix.pch"; sourceTree = ""; };
57 | 27D8CA8617AED367000E42EF /* NSObject_AutoDescription_Mac.1 */ = {isa = PBXFileReference; lastKnownFileType = text.man; path = NSObject_AutoDescription_Mac.1; sourceTree = ""; };
58 | 27D8CA8B17AED3CF000E42EF /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
59 | 27D8CA8E17AED736000E42EF /* NSApplicationSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSApplicationSupport.h; sourceTree = ""; };
60 | 27D8CA8F17AED736000E42EF /* NSApplicationSupport.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSApplicationSupport.m; sourceTree = ""; };
61 | 27D8CA9417AEE463000E42EF /* NAMain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NAMain.h; sourceTree = ""; };
62 | 27D8CA9517AEE463000E42EF /* NAMain.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NAMain.m; sourceTree = ""; };
63 | 27D8CA9717AEE6A3000E42EF /* NAAppDelegate_Mac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NAAppDelegate_Mac.h; sourceTree = ""; };
64 | 27D8CA9817AEE6A3000E42EF /* NAAppDelegate_Mac.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NAAppDelegate_Mac.m; sourceTree = ""; };
65 | /* End PBXFileReference section */
66 |
67 | /* Begin PBXFrameworksBuildPhase section */
68 | 27BD8093173ADE1600FFDF85 /* Frameworks */ = {
69 | isa = PBXFrameworksBuildPhase;
70 | buildActionMask = 2147483647;
71 | files = (
72 | 27BD809A173ADE1600FFDF85 /* UIKit.framework in Frameworks */,
73 | 27BD809C173ADE1600FFDF85 /* Foundation.framework in Frameworks */,
74 | 27BD809E173ADE1600FFDF85 /* CoreGraphics.framework in Frameworks */,
75 | );
76 | runOnlyForDeploymentPostprocessing = 0;
77 | };
78 | 27D8CA7C17AED366000E42EF /* Frameworks */ = {
79 | isa = PBXFrameworksBuildPhase;
80 | buildActionMask = 2147483647;
81 | files = (
82 | 27D8CA8017AED367000E42EF /* Foundation.framework in Frameworks */,
83 | 27D8CA8C17AED3CF000E42EF /* AppKit.framework in Frameworks */,
84 | );
85 | runOnlyForDeploymentPostprocessing = 0;
86 | };
87 | /* End PBXFrameworksBuildPhase section */
88 |
89 | /* Begin PBXGroup section */
90 | 27BD808D173ADE1600FFDF85 = {
91 | isa = PBXGroup;
92 | children = (
93 | 27BD80B6173ADED000FFDF85 /* NSObject+AutoDescription */,
94 | 27D8CA7A17AED246000E42EF /* NSObject-AutoDescription */,
95 | 27BD809F173ADE1600FFDF85 /* NSObject-AutoDescription-iOS */,
96 | 27D8CA8117AED367000E42EF /* NSObject-AutoDescription-Mac */,
97 | 27BD8098173ADE1600FFDF85 /* Frameworks */,
98 | 27BD8097173ADE1600FFDF85 /* Products */,
99 | );
100 | sourceTree = "";
101 | };
102 | 27BD8097173ADE1600FFDF85 /* Products */ = {
103 | isa = PBXGroup;
104 | children = (
105 | 27BD8096173ADE1600FFDF85 /* NSObject-AutoDescription-iOS.app */,
106 | 27D8CA7F17AED366000E42EF /* NSObject-AutoDescription-Mac */,
107 | );
108 | name = Products;
109 | sourceTree = "";
110 | };
111 | 27BD8098173ADE1600FFDF85 /* Frameworks */ = {
112 | isa = PBXGroup;
113 | children = (
114 | 27BD809B173ADE1600FFDF85 /* Foundation.framework */,
115 | 27BD8099173ADE1600FFDF85 /* UIKit.framework */,
116 | 27BD809D173ADE1600FFDF85 /* CoreGraphics.framework */,
117 | 27D8CA8B17AED3CF000E42EF /* AppKit.framework */,
118 | );
119 | name = Frameworks;
120 | sourceTree = "";
121 | };
122 | 27BD809F173ADE1600FFDF85 /* NSObject-AutoDescription-iOS */ = {
123 | isa = PBXGroup;
124 | children = (
125 | 27BD80A8173ADE1600FFDF85 /* NAAppDelegate_iOS.h */,
126 | 27BD80A9173ADE1600FFDF85 /* NAAppDelegate_iOS.m */,
127 | 27BD80A0173ADE1600FFDF85 /* Supporting Files */,
128 | );
129 | path = "NSObject-AutoDescription-iOS";
130 | sourceTree = "";
131 | };
132 | 27BD80A0173ADE1600FFDF85 /* Supporting Files */ = {
133 | isa = PBXGroup;
134 | children = (
135 | 27BD80A1173ADE1600FFDF85 /* NSObject-AutoDescription-Info.plist */,
136 | 27BD80A5173ADE1600FFDF85 /* main.m */,
137 | 27BD80A7173ADE1600FFDF85 /* NSObject-AutoDescription-Prefix.pch */,
138 | );
139 | name = "Supporting Files";
140 | sourceTree = "";
141 | };
142 | 27BD80B6173ADED000FFDF85 /* NSObject+AutoDescription */ = {
143 | isa = PBXGroup;
144 | children = (
145 | 27BD80B7173ADEE500FFDF85 /* NSObject+AutoDescription.h */,
146 | 27BD80B8173ADEE500FFDF85 /* NSObject+AutoDescription.m */,
147 | 27BD80CE173B102B00FFDF85 /* NSObject+CleanDescription.h */,
148 | 27BD80CF173B102B00FFDF85 /* NSObject+CleanDescription.m */,
149 | );
150 | name = "NSObject+AutoDescription";
151 | path = "../NSObject+AutoDescription";
152 | sourceTree = "";
153 | };
154 | 27D8CA7A17AED246000E42EF /* NSObject-AutoDescription */ = {
155 | isa = PBXGroup;
156 | children = (
157 | 27D8CA9417AEE463000E42EF /* NAMain.h */,
158 | 27D8CA9517AEE463000E42EF /* NAMain.m */,
159 | 27BD80C0173AE10E00FFDF85 /* NAUser.h */,
160 | 27BD80C1173AE10E00FFDF85 /* NAUser.m */,
161 | 27BD80C4173AE31200FFDF85 /* NASuperUser.h */,
162 | 27BD80C5173AE31200FFDF85 /* NASuperUser.m */,
163 | 27BD80C7173B03EA00FFDF85 /* NAGroup.h */,
164 | 27BD80C8173B03EA00FFDF85 /* NAGroup.m */,
165 | );
166 | path = "NSObject-AutoDescription";
167 | sourceTree = "";
168 | };
169 | 27D8CA8117AED367000E42EF /* NSObject-AutoDescription-Mac */ = {
170 | isa = PBXGroup;
171 | children = (
172 | 27D8CA9717AEE6A3000E42EF /* NAAppDelegate_Mac.h */,
173 | 27D8CA9817AEE6A3000E42EF /* NAAppDelegate_Mac.m */,
174 | 27D8CA8417AED367000E42EF /* Supporting Files */,
175 | );
176 | path = "NSObject-AutoDescription-Mac";
177 | sourceTree = "";
178 | };
179 | 27D8CA8417AED367000E42EF /* Supporting Files */ = {
180 | isa = PBXGroup;
181 | children = (
182 | 27D8CA8617AED367000E42EF /* NSObject_AutoDescription_Mac.1 */,
183 | 27D8CA8217AED367000E42EF /* main.m */,
184 | 27D8CA8E17AED736000E42EF /* NSApplicationSupport.h */,
185 | 27D8CA8F17AED736000E42EF /* NSApplicationSupport.m */,
186 | 27D8CA8517AED367000E42EF /* NSObject-AutoDescription-Mac-Prefix.pch */,
187 | );
188 | name = "Supporting Files";
189 | sourceTree = "";
190 | };
191 | /* End PBXGroup section */
192 |
193 | /* Begin PBXNativeTarget section */
194 | 27BD8095173ADE1600FFDF85 /* NSObject-AutoDescription-iOS */ = {
195 | isa = PBXNativeTarget;
196 | buildConfigurationList = 27BD80B3173ADE1600FFDF85 /* Build configuration list for PBXNativeTarget "NSObject-AutoDescription-iOS" */;
197 | buildPhases = (
198 | 27BD8092173ADE1600FFDF85 /* Sources */,
199 | 27BD8093173ADE1600FFDF85 /* Frameworks */,
200 | 27BD8094173ADE1600FFDF85 /* Resources */,
201 | );
202 | buildRules = (
203 | );
204 | dependencies = (
205 | );
206 | name = "NSObject-AutoDescription-iOS";
207 | productName = "NSObject-AutoDescription";
208 | productReference = 27BD8096173ADE1600FFDF85 /* NSObject-AutoDescription-iOS.app */;
209 | productType = "com.apple.product-type.application";
210 | };
211 | 27D8CA7E17AED366000E42EF /* NSObject-AutoDescription-Mac */ = {
212 | isa = PBXNativeTarget;
213 | buildConfigurationList = 27D8CA8817AED367000E42EF /* Build configuration list for PBXNativeTarget "NSObject-AutoDescription-Mac" */;
214 | buildPhases = (
215 | 27D8CA7B17AED366000E42EF /* Sources */,
216 | 27D8CA7C17AED366000E42EF /* Frameworks */,
217 | );
218 | buildRules = (
219 | );
220 | dependencies = (
221 | );
222 | name = "NSObject-AutoDescription-Mac";
223 | productName = "NSObject-AutoDescription-Mac";
224 | productReference = 27D8CA7F17AED366000E42EF /* NSObject-AutoDescription-Mac */;
225 | productType = "com.apple.product-type.tool";
226 | };
227 | /* End PBXNativeTarget section */
228 |
229 | /* Begin PBXProject section */
230 | 27BD808E173ADE1600FFDF85 /* Project object */ = {
231 | isa = PBXProject;
232 | attributes = {
233 | LastUpgradeCheck = 0460;
234 | ORGANIZATIONNAME = "Alexey Aleshkov";
235 | };
236 | buildConfigurationList = 27BD8091173ADE1600FFDF85 /* Build configuration list for PBXProject "NSObject-AutoDescription" */;
237 | compatibilityVersion = "Xcode 3.2";
238 | developmentRegion = English;
239 | hasScannedForEncodings = 0;
240 | knownRegions = (
241 | en,
242 | );
243 | mainGroup = 27BD808D173ADE1600FFDF85;
244 | productRefGroup = 27BD8097173ADE1600FFDF85 /* Products */;
245 | projectDirPath = "";
246 | projectRoot = "";
247 | targets = (
248 | 27BD8095173ADE1600FFDF85 /* NSObject-AutoDescription-iOS */,
249 | 27D8CA7E17AED366000E42EF /* NSObject-AutoDescription-Mac */,
250 | );
251 | };
252 | /* End PBXProject section */
253 |
254 | /* Begin PBXResourcesBuildPhase section */
255 | 27BD8094173ADE1600FFDF85 /* Resources */ = {
256 | isa = PBXResourcesBuildPhase;
257 | buildActionMask = 2147483647;
258 | files = (
259 | );
260 | runOnlyForDeploymentPostprocessing = 0;
261 | };
262 | /* End PBXResourcesBuildPhase section */
263 |
264 | /* Begin PBXSourcesBuildPhase section */
265 | 27BD8092173ADE1600FFDF85 /* Sources */ = {
266 | isa = PBXSourcesBuildPhase;
267 | buildActionMask = 2147483647;
268 | files = (
269 | 27BD80A6173ADE1600FFDF85 /* main.m in Sources */,
270 | 27BD80AA173ADE1600FFDF85 /* NAAppDelegate_iOS.m in Sources */,
271 | 27BD80B9173ADEE500FFDF85 /* NSObject+AutoDescription.m in Sources */,
272 | 27BD80C2173AE10E00FFDF85 /* NAUser.m in Sources */,
273 | 27BD80C6173AE31200FFDF85 /* NASuperUser.m in Sources */,
274 | 27BD80C9173B03EA00FFDF85 /* NAGroup.m in Sources */,
275 | 27BD80D0173B102B00FFDF85 /* NSObject+CleanDescription.m in Sources */,
276 | 27D8CA9617AEE463000E42EF /* NAMain.m in Sources */,
277 | );
278 | runOnlyForDeploymentPostprocessing = 0;
279 | };
280 | 27D8CA7B17AED366000E42EF /* Sources */ = {
281 | isa = PBXSourcesBuildPhase;
282 | buildActionMask = 2147483647;
283 | files = (
284 | 27D8CA8317AED367000E42EF /* main.m in Sources */,
285 | 27D8CA9017AED737000E42EF /* NSApplicationSupport.m in Sources */,
286 | 27D8CA9117AEE393000E42EF /* NAUser.m in Sources */,
287 | 27D8CA9217AEE393000E42EF /* NASuperUser.m in Sources */,
288 | 27D8CA9317AEE393000E42EF /* NAGroup.m in Sources */,
289 | 27D8CA9917AEE6A3000E42EF /* NAAppDelegate_Mac.m in Sources */,
290 | 27D8CA9A17AEE6FE000E42EF /* NAMain.m in Sources */,
291 | 27D8CA9E17AEE9BA000E42EF /* NSObject+CleanDescription.m in Sources */,
292 | 27D8CA9F17AEE9BB000E42EF /* NSObject+AutoDescription.m in Sources */,
293 | );
294 | runOnlyForDeploymentPostprocessing = 0;
295 | };
296 | /* End PBXSourcesBuildPhase section */
297 |
298 | /* Begin XCBuildConfiguration section */
299 | 27BD80B1173ADE1600FFDF85 /* Debug */ = {
300 | isa = XCBuildConfiguration;
301 | buildSettings = {
302 | ALWAYS_SEARCH_USER_PATHS = NO;
303 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
304 | CLANG_CXX_LIBRARY = "libc++";
305 | CLANG_ENABLE_OBJC_ARC = YES;
306 | CLANG_WARN_CONSTANT_CONVERSION = YES;
307 | CLANG_WARN_EMPTY_BODY = YES;
308 | CLANG_WARN_ENUM_CONVERSION = YES;
309 | CLANG_WARN_INT_CONVERSION = YES;
310 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
311 | COPY_PHASE_STRIP = NO;
312 | GCC_C_LANGUAGE_STANDARD = gnu99;
313 | GCC_DYNAMIC_NO_PIC = NO;
314 | GCC_OPTIMIZATION_LEVEL = 0;
315 | GCC_PREPROCESSOR_DEFINITIONS = (
316 | "DEBUG=1",
317 | "$(inherited)",
318 | );
319 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
320 | GCC_WARN_ABOUT_RETURN_TYPE = YES;
321 | GCC_WARN_UNINITIALIZED_AUTOS = YES;
322 | GCC_WARN_UNUSED_VARIABLE = YES;
323 | IPHONEOS_DEPLOYMENT_TARGET = 5.0;
324 | MACOSX_DEPLOYMENT_TARGET = 10.6;
325 | ONLY_ACTIVE_ARCH = YES;
326 | };
327 | name = Debug;
328 | };
329 | 27BD80B2173ADE1600FFDF85 /* Release */ = {
330 | isa = XCBuildConfiguration;
331 | buildSettings = {
332 | ALWAYS_SEARCH_USER_PATHS = NO;
333 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
334 | CLANG_CXX_LIBRARY = "libc++";
335 | CLANG_ENABLE_OBJC_ARC = YES;
336 | CLANG_WARN_CONSTANT_CONVERSION = YES;
337 | CLANG_WARN_EMPTY_BODY = YES;
338 | CLANG_WARN_ENUM_CONVERSION = YES;
339 | CLANG_WARN_INT_CONVERSION = YES;
340 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
341 | COPY_PHASE_STRIP = YES;
342 | GCC_C_LANGUAGE_STANDARD = gnu99;
343 | GCC_WARN_ABOUT_RETURN_TYPE = YES;
344 | GCC_WARN_UNINITIALIZED_AUTOS = YES;
345 | GCC_WARN_UNUSED_VARIABLE = YES;
346 | IPHONEOS_DEPLOYMENT_TARGET = 5.0;
347 | MACOSX_DEPLOYMENT_TARGET = 10.6;
348 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
349 | VALIDATE_PRODUCT = YES;
350 | };
351 | name = Release;
352 | };
353 | 27BD80B4173ADE1600FFDF85 /* Debug */ = {
354 | isa = XCBuildConfiguration;
355 | buildSettings = {
356 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
357 | GCC_PREFIX_HEADER = "NSObject-AutoDescription-iOS/NSObject-AutoDescription-Prefix.pch";
358 | INFOPLIST_FILE = "NSObject-AutoDescription-iOS/NSObject-AutoDescription-Info.plist";
359 | PRODUCT_NAME = "$(TARGET_NAME)";
360 | SDKROOT = iphoneos;
361 | WRAPPER_EXTENSION = app;
362 | };
363 | name = Debug;
364 | };
365 | 27BD80B5173ADE1600FFDF85 /* Release */ = {
366 | isa = XCBuildConfiguration;
367 | buildSettings = {
368 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
369 | GCC_PREFIX_HEADER = "NSObject-AutoDescription-iOS/NSObject-AutoDescription-Prefix.pch";
370 | INFOPLIST_FILE = "NSObject-AutoDescription-iOS/NSObject-AutoDescription-Info.plist";
371 | PRODUCT_NAME = "$(TARGET_NAME)";
372 | SDKROOT = iphoneos;
373 | WRAPPER_EXTENSION = app;
374 | };
375 | name = Release;
376 | };
377 | 27D8CA8917AED367000E42EF /* Debug */ = {
378 | isa = XCBuildConfiguration;
379 | buildSettings = {
380 | ARCHS = "$(ARCHS_STANDARD_64_BIT)";
381 | GCC_ENABLE_OBJC_EXCEPTIONS = YES;
382 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
383 | GCC_PREFIX_HEADER = "NSObject-AutoDescription-Mac/NSObject-AutoDescription-Mac-Prefix.pch";
384 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
385 | INFOPLIST_FILE = "NSObject-AutoDescription-Mac/NSObject-AutoDescription-Info.plist";
386 | PRODUCT_NAME = "$(TARGET_NAME)";
387 | SDKROOT = macosx;
388 | };
389 | name = Debug;
390 | };
391 | 27D8CA8A17AED367000E42EF /* Release */ = {
392 | isa = XCBuildConfiguration;
393 | buildSettings = {
394 | ARCHS = "$(ARCHS_STANDARD_64_BIT)";
395 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
396 | GCC_ENABLE_OBJC_EXCEPTIONS = YES;
397 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
398 | GCC_PREFIX_HEADER = "NSObject-AutoDescription-Mac/NSObject-AutoDescription-Mac-Prefix.pch";
399 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
400 | INFOPLIST_FILE = "NSObject-AutoDescription-Mac/NSObject-AutoDescription-Info.plist";
401 | PRODUCT_NAME = "$(TARGET_NAME)";
402 | SDKROOT = macosx;
403 | };
404 | name = Release;
405 | };
406 | /* End XCBuildConfiguration section */
407 |
408 | /* Begin XCConfigurationList section */
409 | 27BD8091173ADE1600FFDF85 /* Build configuration list for PBXProject "NSObject-AutoDescription" */ = {
410 | isa = XCConfigurationList;
411 | buildConfigurations = (
412 | 27BD80B1173ADE1600FFDF85 /* Debug */,
413 | 27BD80B2173ADE1600FFDF85 /* Release */,
414 | );
415 | defaultConfigurationIsVisible = 0;
416 | defaultConfigurationName = Release;
417 | };
418 | 27BD80B3173ADE1600FFDF85 /* Build configuration list for PBXNativeTarget "NSObject-AutoDescription-iOS" */ = {
419 | isa = XCConfigurationList;
420 | buildConfigurations = (
421 | 27BD80B4173ADE1600FFDF85 /* Debug */,
422 | 27BD80B5173ADE1600FFDF85 /* Release */,
423 | );
424 | defaultConfigurationIsVisible = 0;
425 | defaultConfigurationName = Release;
426 | };
427 | 27D8CA8817AED367000E42EF /* Build configuration list for PBXNativeTarget "NSObject-AutoDescription-Mac" */ = {
428 | isa = XCConfigurationList;
429 | buildConfigurations = (
430 | 27D8CA8917AED367000E42EF /* Debug */,
431 | 27D8CA8A17AED367000E42EF /* Release */,
432 | );
433 | defaultConfigurationIsVisible = 0;
434 | defaultConfigurationName = Release;
435 | };
436 | /* End XCConfigurationList section */
437 | };
438 | rootObject = 27BD808E173ADE1600FFDF85 /* Project object */;
439 | }
440 |
--------------------------------------------------------------------------------