From 5ec794dc4d87e2fb1134ef6c80343337838914a0 Mon Sep 17 00:00:00 2001 From: Mattt Thompson Date: Tue, 6 Nov 2012 09:21:41 -0800 Subject: [PATCH] Indenting macro conditionals --- AFNetworking/AFHTTPClient.h | 12 +-- AFNetworking/AFHTTPClient.m | 12 +-- AFNetworking/AFHTTPRequestOperation.m | 4 +- AFNetworking/AFImageRequestOperation.h | 4 +- AFNetworking/AFNetworking.h | 25 +++-- AFNetworking/AFURLConnectionOperation.m | 3 +- Example/AppDelegate.h | 28 +++--- Example/AppDelegate.m | 116 ++++++++++++------------ 8 files changed, 97 insertions(+), 107 deletions(-) diff --git a/AFNetworking/AFHTTPClient.h b/AFNetworking/AFHTTPClient.h index de6ec80..a49833b 100644 --- a/AFNetworking/AFHTTPClient.h +++ b/AFNetworking/AFHTTPClient.h @@ -81,15 +81,15 @@ typedef enum { AFNetworkReachabilityStatusReachableViaWiFi = 2, } AFNetworkReachabilityStatus; #else -#warning SystemConfiguration framework not found in project, or not included in precompiled header. Network reachability functionality will not be available. + #warning SystemConfiguration framework not found in project, or not included in precompiled header. Network reachability functionality will not be available. #endif #ifndef __UTTYPE__ -#if __IPHONE_OS_VERSION_MIN_REQUIRED -#warning MobileCoreServices framework not found in project, or not included in precompiled header. Automatic MIME type detection when uploading files in multipart requests will not be available. -#else -#warning CoreServices framework not found in project, or not included in precompiled header. Automatic MIME type detection when uploading files in multipart requests will not be available. -#endif + #if __IPHONE_OS_VERSION_MIN_REQUIRED + #warning MobileCoreServices framework not found in project, or not included in precompiled header. Automatic MIME type detection when uploading files in multipart requests will not be available. + #else + #warning CoreServices framework not found in project, or not included in precompiled header. Automatic MIME type detection when uploading files in multipart requests will not be available. + #endif #endif typedef enum { diff --git a/AFNetworking/AFHTTPClient.m b/AFNetworking/AFHTTPClient.m index d302478..51c3be8 100644 --- a/AFNetworking/AFHTTPClient.m +++ b/AFNetworking/AFHTTPClient.m @@ -28,15 +28,15 @@ #import #ifdef _SYSTEMCONFIGURATION_H -#import -#import -#import -#import -#import + #import + #import + #import + #import + #import #endif #if __IPHONE_OS_VERSION_MIN_REQUIRED -#import + #import #endif #ifdef _SYSTEMCONFIGURATION_H diff --git a/AFNetworking/AFHTTPRequestOperation.m b/AFNetworking/AFHTTPRequestOperation.m index 3e31962..7b6c591 100644 --- a/AFNetworking/AFHTTPRequestOperation.m +++ b/AFNetworking/AFHTTPRequestOperation.m @@ -25,9 +25,9 @@ // Workaround for change in imp_implementationWithBlock() with Xcode 4.5 #if defined(__IPHONE_6_0) || defined(__MAC_10_8) -#define AF_CAST_TO_BLOCK id + #define AF_CAST_TO_BLOCK id #else -#define AF_CAST_TO_BLOCK __bridge void * + #define AF_CAST_TO_BLOCK __bridge void * #endif NSSet * AFContentTypesFromHTTPHeader(NSString *string) { diff --git a/AFNetworking/AFImageRequestOperation.h b/AFNetworking/AFImageRequestOperation.h index d028a84..05ea106 100644 --- a/AFNetworking/AFImageRequestOperation.h +++ b/AFNetworking/AFImageRequestOperation.h @@ -26,9 +26,9 @@ #import #if __IPHONE_OS_VERSION_MIN_REQUIRED -#import + #import #elif __MAC_OS_X_VERSION_MIN_REQUIRED -#import + #import #endif /** diff --git a/AFNetworking/AFNetworking.h b/AFNetworking/AFNetworking.h index 49e596c..691e4b2 100644 --- a/AFNetworking/AFNetworking.h +++ b/AFNetworking/AFNetworking.h @@ -24,21 +24,20 @@ #import #ifndef _AFNETWORKING_ -#define _AFNETWORKING_ + #define _AFNETWORKING_ -#import "AFURLConnectionOperation.h" + #import "AFURLConnectionOperation.h" -#import "AFHTTPRequestOperation.h" -#import "AFJSONRequestOperation.h" -#import "AFXMLRequestOperation.h" -#import "AFPropertyListRequestOperation.h" -#import "AFHTTPClient.h" + #import "AFHTTPRequestOperation.h" + #import "AFJSONRequestOperation.h" + #import "AFXMLRequestOperation.h" + #import "AFPropertyListRequestOperation.h" + #import "AFHTTPClient.h" -#import "AFImageRequestOperation.h" - -#if __IPHONE_OS_VERSION_MIN_REQUIRED -#import "AFNetworkActivityIndicatorManager.h" -#import "UIImageView+AFNetworking.h" -#endif + #import "AFImageRequestOperation.h" + #if __IPHONE_OS_VERSION_MIN_REQUIRED + #import "AFNetworkActivityIndicatorManager.h" + #import "UIImageView+AFNetworking.h" + #endif #endif /* _AFNETWORKING_ */ diff --git a/AFNetworking/AFURLConnectionOperation.m b/AFNetworking/AFURLConnectionOperation.m index 74d0c0b..0c16464 100644 --- a/AFNetworking/AFURLConnectionOperation.m +++ b/AFNetworking/AFURLConnectionOperation.m @@ -21,8 +21,9 @@ // THE SOFTWARE. #import "AFURLConnectionOperation.h" + #if __IPHONE_OS_VERSION_MIN_REQUIRED -#import + #import #endif #if !__has_feature(objc_arc) diff --git a/Example/AppDelegate.h b/Example/AppDelegate.h index 5e59199..b3c9e36 100644 --- a/Example/AppDelegate.h +++ b/Example/AppDelegate.h @@ -23,28 +23,22 @@ #import #if __IPHONE_OS_VERSION_MIN_REQUIRED + #import -#import + @interface AppDelegate : NSObject -@interface AppDelegate : NSObject { - -} - -@property (nonatomic, strong) UIWindow *window; -@property (nonatomic, strong) UINavigationController *navigationController; - -@end + @property (nonatomic, strong) UIWindow *window; + @property (nonatomic, strong) UINavigationController *navigationController; + @end #else + #import -#import + @interface AppDelegate : NSObject -@interface AppDelegate : NSObject - -@property (strong) IBOutlet NSWindow *window; -@property (strong) IBOutlet NSTableView *tableView; -@property (strong) IBOutlet NSArrayController *postsArrayController; - -@end + @property (strong) IBOutlet NSWindow *window; + @property (strong) IBOutlet NSTableView *tableView; + @property (strong) IBOutlet NSArrayController *postsArrayController; + @end #endif diff --git a/Example/AppDelegate.m b/Example/AppDelegate.m index 0f77ee0..2516b4c 100644 --- a/Example/AppDelegate.m +++ b/Example/AppDelegate.m @@ -23,75 +23,71 @@ #import "AppDelegate.h" #if __IPHONE_OS_VERSION_MIN_REQUIRED + #import "GlobalTimelineViewController.h" -#import "GlobalTimelineViewController.h" + #import "AFNetworkActivityIndicatorManager.h" -#import "AFNetworkActivityIndicatorManager.h" + @implementation AppDelegate + @synthesize window = _window; + @synthesize navigationController = _navigationController; -@implementation AppDelegate -@synthesize window = _window; -@synthesize navigationController = _navigationController; - -- (BOOL)application:(UIApplication *)application -didFinishLaunchingWithOptions:(NSDictionary *)launchOptions -{ - NSURLCache *URLCache = [[NSURLCache alloc] initWithMemoryCapacity:4 * 1024 * 1024 diskCapacity:20 * 1024 * 1024 diskPath:nil]; - [NSURLCache setSharedURLCache:URLCache]; + - (BOOL)application:(UIApplication *)application + didFinishLaunchingWithOptions:(NSDictionary *)launchOptions + { + NSURLCache *URLCache = [[NSURLCache alloc] initWithMemoryCapacity:4 * 1024 * 1024 diskCapacity:20 * 1024 * 1024 diskPath:nil]; + [NSURLCache setSharedURLCache:URLCache]; + + [[AFNetworkActivityIndicatorManager sharedManager] setEnabled:YES]; - [[AFNetworkActivityIndicatorManager sharedManager] setEnabled:YES]; - - UITableViewController *viewController = [[GlobalTimelineViewController alloc] initWithStyle:UITableViewStylePlain]; - self.navigationController = [[UINavigationController alloc] initWithRootViewController:viewController]; - self.navigationController.navigationBar.tintColor = [UIColor darkGrayColor]; - - self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; - self.window.backgroundColor = [UIColor whiteColor]; - self.window.rootViewController = self.navigationController; - [self.window makeKeyAndVisible]; - - return YES; -} - -@end + UITableViewController *viewController = [[GlobalTimelineViewController alloc] initWithStyle:UITableViewStylePlain]; + self.navigationController = [[UINavigationController alloc] initWithRootViewController:viewController]; + self.navigationController.navigationBar.tintColor = [UIColor darkGrayColor]; + + self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; + self.window.backgroundColor = [UIColor whiteColor]; + self.window.rootViewController = self.navigationController; + [self.window makeKeyAndVisible]; + + return YES; + } + @end #else + #import "Post.h" + #import "User.h" -#import "Post.h" -#import "User.h" + @implementation AppDelegate -@implementation AppDelegate + @synthesize window = _window; + @synthesize tableView = _tableView; + @synthesize postsArrayController = _postsArrayController; -@synthesize window = _window; -@synthesize tableView = _tableView; -@synthesize postsArrayController = _postsArrayController; - -- (void)applicationDidFinishLaunching:(NSNotification *)notification { - NSURLCache *URLCache = [[NSURLCache alloc] initWithMemoryCapacity:4 * 1024 * 1024 diskCapacity:20 * 1024 * 1024 diskPath:nil]; - [NSURLCache setSharedURLCache:URLCache]; - - [self.window makeKeyAndOrderFront:self]; - - [Post globalTimelinePostsWithBlock:^(NSArray *posts, NSError *error) { - if (error) { - [[NSAlert alertWithMessageText:NSLocalizedString(@"Error", nil) defaultButton:NSLocalizedString(@"OK", nil) alternateButton:nil otherButton:nil informativeTextWithFormat:@"%@",[error localizedDescription]] runModal]; - } + - (void)applicationDidFinishLaunching:(NSNotification *)notification { + NSURLCache *URLCache = [[NSURLCache alloc] initWithMemoryCapacity:4 * 1024 * 1024 diskCapacity:20 * 1024 * 1024 diskPath:nil]; + [NSURLCache setSharedURLCache:URLCache]; - self.postsArrayController.content = posts; - }]; - - [[NSNotificationCenter defaultCenter] addObserverForName:kUserProfileImageDidLoadNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notification) { - [self.tableView reloadData]; - }]; -} + [self.window makeKeyAndOrderFront:self]; + + [Post globalTimelinePostsWithBlock:^(NSArray *posts, NSError *error) { + if (error) { + [[NSAlert alertWithMessageText:NSLocalizedString(@"Error", nil) defaultButton:NSLocalizedString(@"OK", nil) alternateButton:nil otherButton:nil informativeTextWithFormat:@"%@",[error localizedDescription]] runModal]; + } + + self.postsArrayController.content = posts; + }]; + + [[NSNotificationCenter defaultCenter] addObserverForName:kUserProfileImageDidLoadNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notification) { + [self.tableView reloadData]; + }]; + } -- (BOOL)applicationShouldHandleReopen:(NSApplication *)application - hasVisibleWindows:(BOOL)flag -{ - [self.window makeKeyAndOrderFront:self]; - - return YES; -} + - (BOOL)applicationShouldHandleReopen:(NSApplication *)application + hasVisibleWindows:(BOOL)flag + { + [self.window makeKeyAndOrderFront:self]; + + return YES; + } -@end - -#endif \ No newline at end of file + @end +#endif