From 76db434ab78cd400c1e614f0f593c4b919452aa8 Mon Sep 17 00:00:00 2001 From: Ed Preston Date: Sun, 13 Oct 2013 16:12:07 -0400 Subject: [PATCH 1/4] Conversion to ARC. --- .../Controller/PSHTreeGraphAppDelegate.m | 6 ---- .../Controller/PSHTreeGraphViewController.h | 2 +- .../Controller/PSHTreeGraphViewController.m | 8 +---- .../Model/ObjCClass/ObjCClassWrapper.h | 6 ++-- .../Model/ObjCClass/ObjCClassWrapper.m | 12 ++------ Example 1/Classes/View/MyLeafView.h | 6 ++-- Example 1/Classes/View/MyLeafView.m | 10 ++----- Example 1/Classes/View/MyTreeGraphView.m | 4 --- .../PSHTreeGraph.xcodeproj/project.pbxproj | 2 ++ PSTreeGraphView/PSBaseBranchView.h | 2 +- PSTreeGraphView/PSBaseLeafView.h | 6 ++-- PSTreeGraphView/PSBaseLeafView.m | 29 ++++++------------- PSTreeGraphView/PSBaseSubtreeView.h | 4 +-- PSTreeGraphView/PSBaseSubtreeView.m | 10 +------ PSTreeGraphView/PSBaseTreeGraphView.h | 8 ++--- PSTreeGraphView/PSBaseTreeGraphView.m | 27 ++++------------- 16 files changed, 41 insertions(+), 101 deletions(-) diff --git a/Example 1/Classes/Controller/PSHTreeGraphAppDelegate.m b/Example 1/Classes/Controller/PSHTreeGraphAppDelegate.m index 22c1f7a..74999ec 100644 --- a/Example 1/Classes/Controller/PSHTreeGraphAppDelegate.m +++ b/Example 1/Classes/Controller/PSHTreeGraphAppDelegate.m @@ -46,12 +46,6 @@ - (BOOL) application:(UIApplication *)application didFinishLaunchingWithOptions: #pragma mark - Resouce Management -- (void) dealloc -{ - [viewController_ release]; - [window_ release]; - [super dealloc]; -} @end diff --git a/Example 1/Classes/Controller/PSHTreeGraphViewController.h b/Example 1/Classes/Controller/PSHTreeGraphViewController.h index 858051b..e6a1b48 100644 --- a/Example 1/Classes/Controller/PSHTreeGraphViewController.h +++ b/Example 1/Classes/Controller/PSHTreeGraphViewController.h @@ -17,7 +17,7 @@ @interface PSHTreeGraphViewController : UIViewController // The TreeGraph -@property(nonatomic, assign) IBOutlet PSBaseTreeGraphView *treeGraphView; +@property(nonatomic, weak) IBOutlet PSBaseTreeGraphView *treeGraphView; // The name of the root class that the TreeGraph is currently showing. @property(nonatomic, copy) NSString *rootClassName; diff --git a/Example 1/Classes/Controller/PSHTreeGraphViewController.m b/Example 1/Classes/Controller/PSHTreeGraphViewController.m index 021c3e3..f0cc006 100644 --- a/Example 1/Classes/Controller/PSHTreeGraphViewController.m +++ b/Example 1/Classes/Controller/PSHTreeGraphViewController.m @@ -21,7 +21,7 @@ @interface PSHTreeGraphViewController () { @private - PSBaseTreeGraphView *treeGraphView_; + PSBaseTreeGraphView *__weak treeGraphView_; NSString *rootClassName_; } @@ -41,7 +41,6 @@ - (void) setRootClassName:(NSString *)newRootClassName NSParameterAssert(newRootClassName != nil); if (![rootClassName_ isEqualToString:newRootClassName]) { - [rootClassName_ release]; rootClassName_ = [newRootClassName copy]; treeGraphView_.treeGraphOrientation = PSTreeGraphOrientationStyleHorizontalFlipped; @@ -129,10 +128,5 @@ - (void) viewDidUnload // e.g. self.myOutlet = nil; } -- (void) dealloc -{ - [rootClassName_ release]; - [super dealloc]; -} @end diff --git a/Example 1/Classes/Model/ObjCClass/ObjCClassWrapper.h b/Example 1/Classes/Model/ObjCClass/ObjCClassWrapper.h index ce94c40..2cdfa50 100644 --- a/Example 1/Classes/Model/ObjCClass/ObjCClassWrapper.h +++ b/Example 1/Classes/Model/ObjCClass/ObjCClassWrapper.h @@ -35,18 +35,18 @@ /// The wrappedClass' name (e.g. @"UIControl" or @"CALayer" or "CAAnimation") -@property (nonatomic, readonly) NSString *name; +@property (weak, nonatomic, readonly) NSString *name; /// An ObjCClassWrapper representing the wrappedClass' superclass. -@property (nonatomic, readonly) ObjCClassWrapper *superclassWrapper; +@property (weak, nonatomic, readonly) ObjCClassWrapper *superclassWrapper; /// An array of ObjCClassWrappers representing the wrappedClass' subclasses. /// (For convenience, the subclasses are sorted by name.) -@property (nonatomic, readonly) NSArray *subclasses; +@property (weak, nonatomic, readonly) NSArray *subclasses; /// The wrappedClass' intrinsic instance size (which doesn't include external/auxiliary storage). diff --git a/Example 1/Classes/Model/ObjCClass/ObjCClassWrapper.m b/Example 1/Classes/Model/ObjCClass/ObjCClassWrapper.m index d8fd7bd..12ed583 100644 --- a/Example 1/Classes/Model/ObjCClass/ObjCClassWrapper.m +++ b/Example 1/Classes/Model/ObjCClass/ObjCClassWrapper.m @@ -42,7 +42,7 @@ @implementation ObjCClassWrapper - (id) copyWithZone:(NSZone *)zone { - return [self retain]; + return self; } @@ -55,11 +55,10 @@ - (id) copyWithZone:(NSZone *)zone if (aClass != Nil) { wrappedClass = aClass; if (classToWrapperMapTable == nil) { - classToWrapperMapTable = [[NSMutableDictionary dictionaryWithCapacity:16] retain]; + classToWrapperMapTable = [NSMutableDictionary dictionaryWithCapacity:16]; } classToWrapperMapTable[(id)wrappedClass] = self; } else { - [self release]; return nil; } } @@ -70,7 +69,7 @@ + (ObjCClassWrapper *) wrapperForClass:(Class)aClass { ObjCClassWrapper *wrapper = classToWrapperMapTable[aClass]; if (wrapper == nil) { - wrapper = [[[self alloc] initWithWrappedClass:aClass] autorelease]; + wrapper = [[self alloc] initWithWrappedClass:aClass]; } return wrapper; } @@ -150,10 +149,5 @@ - (NSArray *) childModelNodes #pragma mark - Resource Management -- (void) dealloc -{ - [subclassesCache release]; - [super dealloc]; -} @end diff --git a/Example 1/Classes/View/MyLeafView.h b/Example 1/Classes/View/MyLeafView.h index 790b8f4..999c87b 100644 --- a/Example 1/Classes/View/MyLeafView.h +++ b/Example 1/Classes/View/MyLeafView.h @@ -14,8 +14,8 @@ @interface MyLeafView : PSBaseLeafView -@property (nonatomic, assign) IBOutlet UIButton *expandButton; -@property (nonatomic, assign) IBOutlet UILabel *titleLabel; -@property (nonatomic, assign) IBOutlet UILabel *detailLabel; +@property (nonatomic, weak) IBOutlet UIButton *expandButton; +@property (nonatomic, weak) IBOutlet UILabel *titleLabel; +@property (nonatomic, weak) IBOutlet UILabel *detailLabel; @end diff --git a/Example 1/Classes/View/MyLeafView.m b/Example 1/Classes/View/MyLeafView.m index fea20f6..6185fed 100644 --- a/Example 1/Classes/View/MyLeafView.m +++ b/Example 1/Classes/View/MyLeafView.m @@ -15,9 +15,9 @@ @interface MyLeafView () @private // Interface - UIButton *expandButton_; - UILabel *titleLabel_; - UILabel *detailLabel_; + UIButton *__weak expandButton_; + UILabel *__weak titleLabel_; + UILabel *__weak detailLabel_; } @end @@ -55,9 +55,5 @@ - (id) initWithCoder:(NSCoder *)decoder #pragma mark - Resource Management -- (void) dealloc -{ - [super dealloc]; -} @end diff --git a/Example 1/Classes/View/MyTreeGraphView.m b/Example 1/Classes/View/MyTreeGraphView.m index 8d0bec9..b6af775 100644 --- a/Example 1/Classes/View/MyTreeGraphView.m +++ b/Example 1/Classes/View/MyTreeGraphView.m @@ -45,9 +45,5 @@ - (id) initWithCoder:(NSCoder *)decoder #pragma mark - Resource Management -- (void) dealloc -{ - [super dealloc]; -} @end diff --git a/Example 1/PSHTreeGraph.xcodeproj/project.pbxproj b/Example 1/PSHTreeGraph.xcodeproj/project.pbxproj index 4f979df..418efb4 100755 --- a/Example 1/PSHTreeGraph.xcodeproj/project.pbxproj +++ b/Example 1/PSHTreeGraph.xcodeproj/project.pbxproj @@ -351,6 +351,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ENABLE_OBJC_ARC = YES; CODE_SIGN_ENTITLEMENTS = Entitlements.plist; COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; @@ -370,6 +371,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ENABLE_OBJC_ARC = YES; CODE_SIGN_ENTITLEMENTS = Entitlements.plist; COPY_PHASE_STRIP = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; diff --git a/PSTreeGraphView/PSBaseBranchView.h b/PSTreeGraphView/PSBaseBranchView.h index 539cfab..f9c0047 100644 --- a/PSTreeGraphView/PSBaseBranchView.h +++ b/PSTreeGraphView/PSBaseBranchView.h @@ -26,6 +26,6 @@ /// @note The getter for this is a convenience method that ascends the view tree /// until it encounters a TreeGraph. -@property (nonatomic, readonly) PSBaseTreeGraphView *enclosingTreeGraph; +@property (weak, nonatomic, readonly) PSBaseTreeGraphView *enclosingTreeGraph; @end diff --git a/PSTreeGraphView/PSBaseLeafView.h b/PSTreeGraphView/PSBaseLeafView.h index d0dee6a..065e808 100644 --- a/PSTreeGraphView/PSBaseLeafView.h +++ b/PSTreeGraphView/PSBaseLeafView.h @@ -23,7 +23,7 @@ #pragma mark - Styling /// The color of the ContainerView's stroked border. -@property (nonatomic, retain) UIColor *borderColor; +@property (nonatomic, strong) UIColor *borderColor; /// The width of the ContainerView's stroked border. May be zero. @property (nonatomic, assign) CGFloat borderWidth; @@ -32,10 +32,10 @@ @property (nonatomic, assign) CGFloat cornerRadius; /// The fill color for the ContainerView's interior. -@property (nonatomic, retain) UIColor *fillColor; +@property (nonatomic, strong) UIColor *fillColor; /// The fill color for the ContainerView's interior when selected. -@property (nonatomic, retain) UIColor *selectionColor; +@property (nonatomic, strong) UIColor *selectionColor; #pragma mark - Selection State diff --git a/PSTreeGraphView/PSBaseLeafView.m b/PSTreeGraphView/PSBaseLeafView.m index 20ba101..7942dd2 100644 --- a/PSTreeGraphView/PSBaseLeafView.m +++ b/PSTreeGraphView/PSBaseLeafView.m @@ -49,8 +49,7 @@ @implementation PSBaseLeafView - (void) setBorderColor:(UIColor *)color { if (borderColor_ != color) { - [borderColor_ release]; - borderColor_ = [color retain]; + borderColor_ = color; [self updateLayerAppearanceToMatchContainerView]; } } @@ -80,8 +79,7 @@ - (void) setCornerRadius:(CGFloat)radius - (void) setFillColor:(UIColor *)color { if (fillColor_ != color) { - [fillColor_ release]; - fillColor_ = [color retain]; + fillColor_ = color; [self updateLayerAppearanceToMatchContainerView]; } } @@ -91,8 +89,7 @@ - (void) setFillColor:(UIColor *)color - (void) setSelectionColor:(UIColor *)color { if (selectionColor_ != color) { - [selectionColor_ release]; - selectionColor_ = [color retain]; + selectionColor_ = color; [self updateLayerAppearanceToMatchContainerView]; } } @@ -156,25 +153,17 @@ - (void) configureDetaults // Initialize ivars directly. As a rule, it's best to avoid invoking accessors from an -init... // method, since they may wrongly expect the instance to be fully formed. - borderColor_ = [[UIColor colorWithRed:1.0 green:0.8 blue:0.4 alpha:1.0] retain]; + borderColor_ = [UIColor colorWithRed:1.0 green:0.8 blue:0.4 alpha:1.0]; borderWidth_ = 3.0; cornerRadius_ = 8.0; - fillColor_ = [[UIColor colorWithRed:1.0 green:0.5 blue:0.0 alpha:1.0] retain]; - selectionColor_ = [[UIColor colorWithRed:1.0 green:1.0 blue:0.0 alpha:1.0] retain]; + fillColor_ = [UIColor colorWithRed:1.0 green:0.5 blue:0.0 alpha:1.0]; + selectionColor_ = [UIColor colorWithRed:1.0 green:1.0 blue:0.0 alpha:1.0]; showingSelected_ = NO; } #pragma mark - Resource Management -- (void) dealloc -{ - [borderColor_ release]; - [fillColor_ release]; - [selectionColor_ release]; - - [super dealloc]; -} #pragma mark - UIView @@ -211,15 +200,15 @@ - (id) initWithCoder:(NSCoder *)decoder [self configureDetaults]; if ([decoder containsValueForKey:@"borderColor"]) - borderColor_ = [[decoder decodeObjectForKey:@"borderColor"] retain]; + borderColor_ = [decoder decodeObjectForKey:@"borderColor"]; if ([decoder containsValueForKey:@"borderWidth"]) borderWidth_ = [decoder decodeFloatForKey:@"borderWidth"]; if ([decoder containsValueForKey:@"cornerRadius"]) cornerRadius_ = [decoder decodeFloatForKey:@"cornerRadius"]; if ([decoder containsValueForKey:@"fillColor"]) - fillColor_ = [[decoder decodeObjectForKey:@"fillColor"] retain]; + fillColor_ = [decoder decodeObjectForKey:@"fillColor"]; if ([decoder containsValueForKey:@"selectionColor"]) - selectionColor_ = [[decoder decodeObjectForKey:@"selectionColor"] retain]; + selectionColor_ = [decoder decodeObjectForKey:@"selectionColor"]; if ([decoder containsValueForKey:@"showingSelected"]) showingSelected_ = [decoder decodeBoolForKey:@"showingSelected"]; diff --git a/PSTreeGraphView/PSBaseSubtreeView.h b/PSTreeGraphView/PSBaseSubtreeView.h index b9f6ad8..70de5f0 100644 --- a/PSTreeGraphView/PSBaseSubtreeView.h +++ b/PSTreeGraphView/PSBaseSubtreeView.h @@ -37,12 +37,12 @@ /// The view that represents the modelNode. Is a subview of SubtreeView, and may itself have descendant views. -@property (nonatomic, assign) IBOutlet UIView *nodeView; +@property (nonatomic, weak) IBOutlet UIView *nodeView; /// Link to the enclosing TreeGraph. (The getter for this is a convenience method that ascends /// the view tree until it encounters a TreeGraph.) -@property (nonatomic, readonly) PSBaseTreeGraphView *enclosingTreeGraph; +@property (weak, nonatomic, readonly) PSBaseTreeGraphView *enclosingTreeGraph; // Whether the model node represented by this SubtreeView is a leaf node (one without child nodes). This // can be a useful property to bind user interface state to. In the TreeGraph demo app, for example, diff --git a/PSTreeGraphView/PSBaseSubtreeView.m b/PSTreeGraphView/PSBaseSubtreeView.m index d9bf4a6..4fe0789 100644 --- a/PSTreeGraphView/PSBaseSubtreeView.m +++ b/PSTreeGraphView/PSBaseSubtreeView.m @@ -44,7 +44,7 @@ @interface PSBaseSubtreeView () id modelNode_; // the model node that nodeView represents // Views - UIView *nodeView_; // the subview of this SubtreeView that shows a representation + UIView *__weak nodeView_; // the subview of this SubtreeView that shows a representation // of the modelNode PSBaseBranchView *connectorsView_; // the view that shows connections from nodeView to its child nodes @@ -165,14 +165,6 @@ - (PSBaseTreeGraphView *) enclosingTreeGraph #pragma mark - Resource Management -- (void) dealloc -{ - // [nodeView release]; // not retained, since an IBOutlet - [connectorsView_ release]; - [modelNode_ release]; - - [super dealloc]; -} #pragma mark - Layout diff --git a/PSTreeGraphView/PSBaseTreeGraphView.h b/PSTreeGraphView/PSBaseTreeGraphView.h index 8a5959c..c23c27b 100644 --- a/PSTreeGraphView/PSBaseTreeGraphView.h +++ b/PSTreeGraphView/PSBaseTreeGraphView.h @@ -84,7 +84,7 @@ typedef enum PSTreeGraphOrientationStyle : NSUInteger { /// read-only accessor provides a way to get the rootmost SubtreeView (the one that corresponds /// to the modelRoot model node). -@property (nonatomic, readonly) PSBaseSubtreeView *rootSubtreeView; +@property (weak, nonatomic, readonly) PSBaseSubtreeView *rootSubtreeView; #pragma mark - Node View Nib Specification @@ -110,7 +110,7 @@ typedef enum PSTreeGraphOrientationStyle : NSUInteger { /// Convenience accessor that returns the selected node, if exactly one node is currently /// selected. Returns nil if zero, or more than one, nodes are currently selected. -@property (nonatomic, readonly) id singleSelectedModelNode; +@property (weak, nonatomic, readonly) id singleSelectedModelNode; /// Returns the bounding box of the selectedModelNodes. The bounding box takes only the selected /// nodes into account, disregarding any descendants they might have. @@ -238,7 +238,7 @@ typedef enum PSTreeGraphOrientationStyle : NSUInteger { /// The stroke color for node connecting lines. -@property (nonatomic, retain) UIColor *connectingLineColor; +@property (nonatomic, strong) UIColor *connectingLineColor; /// The width for node connecting lines. @@ -273,7 +273,7 @@ typedef enum PSTreeGraphOrientationStyle : NSUInteger { /// Custom navigation can be added by assigning a custom UIView to inputView, and linking /// it up to some of the actions below. -@property (nonatomic, retain) IBOutlet UIView *inputView; +@property (nonatomic, strong) IBOutlet UIView *inputView; // Model relative navigation - (void) moveToSiblingByRelativeIndex:(NSInteger)relativeIndex; diff --git a/PSTreeGraphView/PSBaseTreeGraphView.m b/PSTreeGraphView/PSBaseTreeGraphView.m index a86bcc6..155b8cd 100644 --- a/PSTreeGraphView/PSBaseTreeGraphView.m +++ b/PSTreeGraphView/PSBaseTreeGraphView.m @@ -108,8 +108,7 @@ @implementation PSBaseTreeGraphView - (void) setConnectingLineColor:(UIColor *)newConnectingLineColor { if (connectingLineColor_ != newConnectingLineColor) { - [connectingLineColor_ release]; - connectingLineColor_ = [newConnectingLineColor retain]; + connectingLineColor_ = newConnectingLineColor; [[self rootSubtreeView] recursiveSetConnectorsViewsNeedDisplay]; } } @@ -216,7 +215,7 @@ - (void) configureDefaults // since they may wrongly expect the instance to be fully formed. // May be configured by user in code, loaded from NSCoder, etc - connectingLineColor_ = [[UIColor blackColor] retain]; + connectingLineColor_ = [UIColor blackColor]; contentMargin_ = 20.0; parentChildSpacing_ = 50.0; siblingSpacing_ = 10.0; @@ -232,7 +231,7 @@ - (void) configureDefaults showsSubtreeFrames_ = NO; minimumFrameSize_ = CGSizeMake(2.0 * contentMargin_, 2.0 * contentMargin_); selectedModelNodes_ = [[NSMutableSet alloc] init]; - modelNodeToSubtreeViewMapTable_ = [[NSMutableDictionary dictionaryWithCapacity:10] retain]; + modelNodeToSubtreeViewMapTable_ = [NSMutableDictionary dictionaryWithCapacity:10]; // If this has been configured by the XIB, leave it during initialization. if (inputView_ == nil) { @@ -246,17 +245,10 @@ - (void) configureDefaults - (void) dealloc { // iOS 4.0 and above ONLY - [cachedNodeViewNib_ release]; self.delegate = nil; - [inputView_ release]; - [nodeViewNibName_ release]; - [selectedModelNodes_ release]; - [modelRoot_ release]; - [modelNodeToSubtreeViewMapTable_ release]; // [backgroundColor release]; - [super dealloc]; } @@ -307,7 +299,7 @@ - (id) initWithCoder:(NSCoder *)decoder if ([decoder containsValueForKey:@"resizesToFillEnclosingScrollView"]) resizesToFillEnclosingScrollView_ = [decoder decodeBoolForKey:@"resizesToFillEnclosingScrollView"]; if ([decoder containsValueForKey:@"connectingLineColor"]) - connectingLineColor_ = [[decoder decodeObjectForKey:@"connectingLineColor"] retain]; + connectingLineColor_ = [decoder decodeObjectForKey:@"connectingLineColor"]; if ([decoder containsValueForKey:@"connectingLineWidth"]) connectingLineWidth_ = [decoder decodeFloatForKey:@"connectingLineWidth"]; @@ -349,8 +341,7 @@ - (UINib *) cachedNodeViewNib { - (void) setCachedNodeViewNib:(UINib *)newNib { if (cachedNodeViewNib_ != newNib) { - [cachedNodeViewNib_ release]; - cachedNodeViewNib_ = [newNib retain]; + cachedNodeViewNib_ = newNib; } } @@ -366,7 +357,6 @@ - (void) setNodeViewNibName:(NSString *)newName // iOS 4.0 and above ONLY [self setCachedNodeViewNib:nil]; - [nodeViewNibName_ release]; nodeViewNibName_ = [newName copy]; // TODO: Tear down and (later) rebuild view tree. @@ -408,7 +398,6 @@ - (void) setSelectedModelNodes:(NSSet *)newSelectedModelNodes [differenceSet minusSet:intersectionSet]; // Discard the old selectedModelNodes set and replace it with the new one. - [selectedModelNodes_ release]; selectedModelNodes_ = [newSelectedModelNodes mutableCopy]; for (id modelNode in differenceSet) { @@ -422,9 +411,6 @@ - (void) setSelectedModelNodes:(NSSet *)newSelectedModelNodes } // Release the temporary sets we created. - [differenceSet release]; - [combinedSet release]; - [intersectionSet release]; } } @@ -496,13 +482,11 @@ - (PSBaseSubtreeView *) newGraphForModelNode:(id )modelNo // collapse the subtree, its nodeView will remain frontmost). [subtreeView insertSubview:childSubtreeView belowSubview:[subtreeView nodeView]]; - [childSubtreeView release]; } } } } else { - [subtreeView release]; subtreeView = nil; } } @@ -520,7 +504,6 @@ - (void) buildGraph PSBaseSubtreeView *rootSubtreeView = [self newGraphForModelNode:root]; if (rootSubtreeView) { [self addSubview:rootSubtreeView]; - [rootSubtreeView release]; } } From a650f753c9edb72eff03b5eb35ccb1e81b55c921 Mon Sep 17 00:00:00 2001 From: Ed Preston Date: Sun, 13 Oct 2013 16:20:25 -0400 Subject: [PATCH 2/4] Removed orphaned comments after ARC conversion. --- Example 1/Classes/View/MyLeafView.m | 3 --- Example 1/Classes/View/MyTreeGraphView.m | 2 -- PSTreeGraphView/PSBaseLeafView.m | 4 ---- PSTreeGraphView/PSBaseSubtreeView.m | 8 ++------ PSTreeGraphView/PSBaseTreeGraphView.m | 4 ---- 5 files changed, 2 insertions(+), 19 deletions(-) diff --git a/Example 1/Classes/View/MyLeafView.m b/Example 1/Classes/View/MyLeafView.m index 6185fed..c6261fa 100644 --- a/Example 1/Classes/View/MyLeafView.m +++ b/Example 1/Classes/View/MyLeafView.m @@ -53,7 +53,4 @@ - (id) initWithCoder:(NSCoder *)decoder } -#pragma mark - Resource Management - - @end diff --git a/Example 1/Classes/View/MyTreeGraphView.m b/Example 1/Classes/View/MyTreeGraphView.m index b6af775..b3f7232 100644 --- a/Example 1/Classes/View/MyTreeGraphView.m +++ b/Example 1/Classes/View/MyTreeGraphView.m @@ -43,7 +43,5 @@ - (id) initWithCoder:(NSCoder *)decoder return self; } -#pragma mark - Resource Management - @end diff --git a/PSTreeGraphView/PSBaseLeafView.m b/PSTreeGraphView/PSBaseLeafView.m index 7942dd2..d0cc15f 100644 --- a/PSTreeGraphView/PSBaseLeafView.m +++ b/PSTreeGraphView/PSBaseLeafView.m @@ -162,10 +162,6 @@ - (void) configureDetaults } -#pragma mark - Resource Management - - - #pragma mark - UIView - initWithFrame:(CGRect)newFrame diff --git a/PSTreeGraphView/PSBaseSubtreeView.m b/PSTreeGraphView/PSBaseSubtreeView.m index 4fe0789..297c7b4 100644 --- a/PSTreeGraphView/PSBaseSubtreeView.m +++ b/PSTreeGraphView/PSBaseSubtreeView.m @@ -163,9 +163,6 @@ - (PSBaseTreeGraphView *) enclosingTreeGraph return nil; } -#pragma mark - Resource Management - - #pragma mark - Layout @@ -193,8 +190,8 @@ - (void) flipTreeGraph { // Recurse for descendant SubtreeViews. CGFloat myWidth = self.frame.size.width; - CGFloat myHeight = self.frame.size.height; - PSBaseTreeGraphView *treeGraph = [self enclosingTreeGraph]; + CGFloat myHeight = self.frame.size.height; + PSBaseTreeGraphView *treeGraph = [self enclosingTreeGraph]; PSTreeGraphOrientationStyle treeOrientation = [treeGraph treeGraphOrientation]; NSArray *subviews = [self subviews]; @@ -217,7 +214,6 @@ - (void) flipTreeGraph } } - - (CGSize) layoutGraphIfNeeded { // Return early if layout not needed diff --git a/PSTreeGraphView/PSBaseTreeGraphView.m b/PSTreeGraphView/PSBaseTreeGraphView.m index 155b8cd..d872a87 100644 --- a/PSTreeGraphView/PSBaseTreeGraphView.m +++ b/PSTreeGraphView/PSBaseTreeGraphView.m @@ -244,11 +244,7 @@ - (void) configureDefaults - (void) dealloc { - // iOS 4.0 and above ONLY - self.delegate = nil; - - // [backgroundColor release]; } From bbb94806047587bd303e0da825baba726cc76589 Mon Sep 17 00:00:00 2001 From: Ed Preston Date: Sun, 13 Oct 2013 16:43:21 -0400 Subject: [PATCH 3/4] Updated README concerning move to ARC. --- Example 1/PSHTreeGraph.xcodeproj/project.pbxproj | 2 ++ README.md | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Example 1/PSHTreeGraph.xcodeproj/project.pbxproj b/Example 1/PSHTreeGraph.xcodeproj/project.pbxproj index 418efb4..f7ad4cf 100755 --- a/Example 1/PSHTreeGraph.xcodeproj/project.pbxproj +++ b/Example 1/PSHTreeGraph.xcodeproj/project.pbxproj @@ -46,6 +46,7 @@ 32CA4F630368D1EE00C91783 /* PSHTreeGraph_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PSHTreeGraph_Prefix.pch; sourceTree = ""; }; 4F0E109E1407EB94009B9214 /* Doxyfile */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; name = Doxyfile; path = ../Doxyfile; sourceTree = ""; }; 4F0EE31B15D2F99B009BC883 /* PSTreeGraphDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PSTreeGraphDelegate.h; sourceTree = ""; }; + 4F2A233D180B3AEB00778BA1 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = text; name = README.md; path = ../README.md; sourceTree = ""; }; 4F3536F311FC851F00AABFF1 /* MyTreeGraphView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MyTreeGraphView.h; path = Classes/View/MyTreeGraphView.h; sourceTree = SOURCE_ROOT; }; 4F3536F411FC851F00AABFF1 /* MyTreeGraphView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MyTreeGraphView.m; path = Classes/View/MyTreeGraphView.m; sourceTree = SOURCE_ROOT; }; 4F35379511FC8EC900AABFF1 /* PSBaseBranchView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PSBaseBranchView.h; path = ../PSTreeGraphView/PSBaseBranchView.h; sourceTree = ""; }; @@ -119,6 +120,7 @@ 29B97315FDCFA39411CA2CEA /* Other Sources */ = { isa = PBXGroup; children = ( + 4F2A233D180B3AEB00778BA1 /* README.md */, 4F0E109E1407EB94009B9214 /* Doxyfile */, 32CA4F630368D1EE00C91783 /* PSHTreeGraph_Prefix.pch */, 29B97316FDCFA39411CA2CEA /* main.m */, diff --git a/README.md b/README.md index 7083c6c..fce172d 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ There is an iPad example application to demonstrate the features of PSTreeGraph. # Status -PSTreeGraph should be considered an viable solution for displaying single parent tree data in an interactive hierarchy. +PSTreeGraph should be considered an viable solution for displaying single parent tree data in an interactive hierarchy. The "ARC" branch contains the automatic reference counting compatible code base. In the very near future, this will be merged with "master", non "ARC" code will be frozen at the 1.0 release. Those looking for a reference counted implementation should look for a "Non ARC 1.0" branch. This project follows the [SemVer](http://semver.org/) standard. The API may change in backwards-incompatible ways before the 1.0 release. From 1d5eefb20526399eac1b5374d746d7706a00f1a3 Mon Sep 17 00:00:00 2001 From: Ed Preston Date: Sun, 13 Oct 2013 16:51:54 -0400 Subject: [PATCH 4/4] Line wrap mode when viewing readme. --- Example 1/PSHTreeGraph.xcodeproj/project.pbxproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Example 1/PSHTreeGraph.xcodeproj/project.pbxproj b/Example 1/PSHTreeGraph.xcodeproj/project.pbxproj index f7ad4cf..349f3c2 100755 --- a/Example 1/PSHTreeGraph.xcodeproj/project.pbxproj +++ b/Example 1/PSHTreeGraph.xcodeproj/project.pbxproj @@ -46,7 +46,7 @@ 32CA4F630368D1EE00C91783 /* PSHTreeGraph_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PSHTreeGraph_Prefix.pch; sourceTree = ""; }; 4F0E109E1407EB94009B9214 /* Doxyfile */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; name = Doxyfile; path = ../Doxyfile; sourceTree = ""; }; 4F0EE31B15D2F99B009BC883 /* PSTreeGraphDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PSTreeGraphDelegate.h; sourceTree = ""; }; - 4F2A233D180B3AEB00778BA1 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = text; name = README.md; path = ../README.md; sourceTree = ""; }; + 4F2A233D180B3AEB00778BA1 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = text; name = README.md; path = ../README.md; sourceTree = ""; wrapsLines = 1; }; 4F3536F311FC851F00AABFF1 /* MyTreeGraphView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MyTreeGraphView.h; path = Classes/View/MyTreeGraphView.h; sourceTree = SOURCE_ROOT; }; 4F3536F411FC851F00AABFF1 /* MyTreeGraphView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MyTreeGraphView.m; path = Classes/View/MyTreeGraphView.m; sourceTree = SOURCE_ROOT; }; 4F35379511FC8EC900AABFF1 /* PSBaseBranchView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PSBaseBranchView.h; path = ../PSTreeGraphView/PSBaseBranchView.h; sourceTree = ""; };