Permalink
Browse files

Updated property declarations in most headers

Most property declarations did not have very specific attributes.
  • Loading branch information...
1 parent 347003d commit 616f319ebd37f2774a3adec995a73e699b877814 @epreston committed Aug 25, 2011
@@ -18,8 +18,8 @@ @implementation PSHTreeGraphAppDelegate
#pragma mark - Application Lifecycle
-- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
-
+- (BOOL) application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
+{
// Override point for customization after app launch.
[window addSubview:viewController.view];
[window makeKeyAndVisible];
@@ -28,7 +28,8 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
}
-- (void)applicationWillResignActive:(UIApplication *)application {
+- (void) applicationWillResignActive:(UIApplication *)application
+{
// Sent when the application is about to move from active to inactive state. This can occur for
// certain types of temporary interruptions (such as an incoming phone call or SMS message) or
// when the user quits the application and it begins the transition to the background state.
@@ -38,26 +39,30 @@ - (void)applicationWillResignActive:(UIApplication *)application {
}
-- (void)applicationDidBecomeActive:(UIApplication *)application {
+- (void) applicationDidBecomeActive:(UIApplication *)application
+{
// Restart any tasks that were paused (or not yet started) while the application was inactive.
// If the application was previously in the background, optionally refresh the user interface.
}
-- (void)applicationWillTerminate:(UIApplication *)application {
+- (void) applicationWillTerminate:(UIApplication *)application
+{
// Called when the application is about to terminate.
// See also applicationDidEnterBackground:.
}
-#pragma mark - Memory Management
+#pragma mark - Resouce Management
-- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application {
+- (void) applicationDidReceiveMemoryWarning:(UIApplication *)application
+{
// Free up as much memory as possible by purging cached data objects that can be recreated
// (or reloaded from disk) later.
}
-- (void)dealloc {
+- (void) dealloc
+{
[viewController release];
[window release];
[super dealloc];
@@ -19,10 +19,10 @@
}
// The TreeGraph
-@property(assign) IBOutlet PSBaseTreeGraphView *treeGraphView;
+@property(nonatomic, assign) IBOutlet PSBaseTreeGraphView *treeGraphView;
// The name of the root class that the TreeGraph is currently showing.
-@property(copy) NSString *rootClassName;
+@property(nonatomic, copy) NSString *rootClassName;
@end
@@ -22,12 +22,13 @@ @implementation PSHTreeGraphViewController
@synthesize treeGraphView;
-- (NSString *)rootClassName {
+- (NSString *) rootClassName
+{
return rootClassName;
}
-- (void)setRootClassName:(NSString *)newRootClassName {
-
+- (void) setRootClassName:(NSString *)newRootClassName
+{
NSParameterAssert(newRootClassName != nil);
if (![rootClassName isEqualToString:newRootClassName]) {
@@ -42,22 +43,9 @@ - (void)setRootClassName:(NSString *)newRootClassName {
#pragma mark - View Creation and Initializer
-// The designated initializer. Override to perform setup that is required before the view is loaded.
-//- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
-// if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) {
-// // Custom initialization
-// }
-// return self;
-//}
-
-
-// Implement loadView to create a view hierarchy programmatically, without using a nib.
-//- (void)loadView {
-//}
-
-
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
-- (void)viewDidLoad {
+- (void) viewDidLoad
+{
[super viewDidLoad];
// Set the delegate to self.
@@ -72,13 +60,14 @@ - (void)viewDidLoad {
// Override to allow orientations other than the default portrait orientation.
-- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
+- (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
+{
return YES;
}
-- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
- duration:(NSTimeInterval)duration {
-
+- (void) willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
+ duration:(NSTimeInterval)duration
+{
// Keep the view in sync
[treeGraphView parentClipViewDidResize:nil];
}
@@ -87,8 +76,8 @@ - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)interf
#pragma mark - TreeGraph Delegate
-(void) configureNodeView:(UIView *)nodeView
- withModelNode:(id <PSTreeGraphModelNode> )modelNode {
-
+ withModelNode:(id <PSTreeGraphModelNode> )modelNode
+{
NSParameterAssert(nodeView != nil);
NSParameterAssert(modelNode != nil);
@@ -108,21 +97,24 @@ -(void) configureNodeView:(UIView *)nodeView
}
-#pragma mark - Memory Management
+#pragma mark - Resouce Management
-- (void)didReceiveMemoryWarning {
+- (void) didReceiveMemoryWarning
+{
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
// Release any cached data, images, etc that aren't in use.
}
-- (void)viewDidUnload {
+- (void) viewDidUnload
+{
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}
-- (void)dealloc {
+- (void) dealloc
+{
[rootClassName release];
[super dealloc];
}
@@ -26,32 +26,32 @@
// Returns an ObjCClassWrapper for the given Objective-C class. ObjCClassWrapper maintains
// a set of unique instances, so this will always return the same ObjCClassWrapper for a given Class.
-+ (ObjCClassWrapper *)wrapperForClass:(Class)aClass;
++ (ObjCClassWrapper *) wrapperForClass:(Class)aClass;
// Returns an ObjCClassWrapper for the given Objective-C class, by looking the Class up by
// name and then invoking +wrapperForClass:
-+ (ObjCClassWrapper *)wrapperForClassNamed:(NSString *)aClassName;
++ (ObjCClassWrapper *) wrapperForClassNamed:(NSString *)aClassName;
#pragma mark - Property Accessors
// The wrappedClass' name (e.g. @"UIButton")
-@property(readonly) NSString *name;
+@property (nonatomic, readonly) NSString *name;
// An ObjCClassWrapper representing the wrappedClass' superclass.
-@property(readonly) ObjCClassWrapper *superclassWrapper;
+@property (nonatomic, readonly) ObjCClassWrapper *superclassWrapper;
// An array of ObjCClassWrappers representing the wrappedClass' subclasses.
// (For convenience, the subclasses are sorted by name.)
-@property(readonly) NSArray *subclasses;
+@property (nonatomic, readonly) NSArray *subclasses;
// The wrappedClass' intrinsic instance size (which doesn't include external/auxiliary storage).
-@property(readonly) size_t wrappedClassInstanceSize;
+@property (nonatomic, readonly) size_t wrappedClassInstanceSize;
@end
@@ -15,9 +15,11 @@
static NSMutableDictionary *classToWrapperMapTable = nil;
+
// Compares two ObjCClassWrappers by name, and returns an NSComparisonResult.
-static NSInteger CompareClassNames(id classA, id classB, void* context) {
+static NSInteger CompareClassNames(id classA, id classB, void* context)
+{
return [[classA description] compare:[classB description]];
}
@@ -26,14 +28,16 @@ static NSInteger CompareClassNames(id classA, id classB, void* context) {
@implementation ObjCClassWrapper
-- (id)copyWithZone:(NSZone *)zone {
+- (id) copyWithZone:(NSZone *)zone
+{
return [self retain];
}
#pragma mark - Creating Instances
-- initWithWrappedClass:(Class)aClass {
+- initWithWrappedClass:(Class)aClass
+{
self = [super init];
if (self) {
if (aClass != Nil) {
@@ -50,39 +54,45 @@ - (id)copyWithZone:(NSZone *)zone {
return self;
}
-+ (ObjCClassWrapper *)wrapperForClass:(Class)aClass {
++ (ObjCClassWrapper *) wrapperForClass:(Class)aClass
+{
ObjCClassWrapper *wrapper = [classToWrapperMapTable objectForKey:aClass];
if (wrapper == nil) {
wrapper = [[[self alloc] initWithWrappedClass:aClass] autorelease];
}
return wrapper;
}
-+ (ObjCClassWrapper *)wrapperForClassNamed:(NSString *)aClassName {
++ (ObjCClassWrapper *) wrapperForClassNamed:(NSString *)aClassName
+{
return [self wrapperForClass:NSClassFromString(aClassName)];
}
#pragma mark - Property Accessors
-- (NSString *)name {
+- (NSString *) name
+{
return NSStringFromClass(wrappedClass);
}
-- (NSString *)description {
+- (NSString *) description
+{
return [self name];
}
-- (size_t)wrappedClassInstanceSize {
+- (size_t) wrappedClassInstanceSize
+{
return class_getInstanceSize(wrappedClass);
}
-- (ObjCClassWrapper *)superclassWrapper {
+- (ObjCClassWrapper *) superclassWrapper
+{
return [[self class] wrapperForClass:class_getSuperclass(wrappedClass)];
}
-- (NSArray *)subclasses {
-
+- (NSArray *) subclasses
+{
// If we haven't built our array of subclasses yet, do so.
if (subclassesCache == nil) {
@@ -115,18 +125,21 @@ - (NSArray *)subclasses {
#pragma mark - TreeGraphModelNode Protocol
-- (id <PSTreeGraphModelNode> )parentModelNode {
+- (id <PSTreeGraphModelNode> ) parentModelNode
+{
return [self superclassWrapper];
}
-- (NSArray *)childModelNodes {
+- (NSArray *) childModelNodes
+{
return [self subclasses];
}
-#pragma mark - Memory Management
+#pragma mark - Resource Management
-- (void)dealloc {
+- (void) dealloc
+{
[subclassesCache release];
[super dealloc];
}
@@ -19,8 +19,8 @@
UILabel *detailLabel;
}
-@property(assign) IBOutlet UIButton *expandButton;
-@property(assign) IBOutlet UILabel *titleLabel;
-@property(assign) IBOutlet UILabel *detailLabel;
+@property (nonatomic, assign) IBOutlet UIButton *expandButton;
+@property (nonatomic, assign) IBOutlet UILabel *titleLabel;
+@property (nonatomic, assign) IBOutlet UILabel *detailLabel;
@end
@@ -14,14 +14,16 @@ @implementation PSHLeafView
@synthesize expandButton, titleLabel, detailLabel;
-- (id)initWithFrame:(CGRect)frame {
+- (id) initWithFrame:(CGRect)frame
+{
if ((self = [super initWithFrame:frame])) {
// Initialization code
}
return self;
}
-- (void)dealloc {
+- (void) dealloc
+{
[super dealloc];
}
@@ -13,14 +13,16 @@
@implementation PSHTreeGraphView
-- (id)initWithFrame:(CGRect)frame {
+- (id) initWithFrame:(CGRect)frame
+{
if ((self = [super initWithFrame:frame])) {
// Initialization code
}
return self;
}
-- (void)dealloc {
+- (void) dealloc
+{
[super dealloc];
}
@@ -25,6 +25,6 @@
// Link to the enclosing TreeGraph. (The getter for this is a convenience method that ascends the view tree
// until it encounters a TreeGraph.)
-@property(readonly) PSBaseTreeGraphView *enclosingTreeGraph;
+@property (nonatomic, readonly) PSBaseTreeGraphView *enclosingTreeGraph;
@end
Oops, something went wrong.

0 comments on commit 616f319

Please sign in to comment.