Skip to content
Browse files

Switch to ARC.

  • Loading branch information...
1 parent 9ed55ed commit d22a5a931bf58882a04583198e2442c46ce9d5e6 @mbaltaks committed
Showing with 10 additions and 29 deletions.
  1. +2 −5 Classes/MGSplitCornersView.m
  2. +1 −3 Classes/MGSplitDividerView.m
  3. +7 −21 Classes/MGSplitViewController.m
View
7 Classes/MGSplitCornersView.m
@@ -33,9 +33,7 @@ - (id)initWithFrame:(CGRect)frame
- (void)dealloc
{
- self.cornerBackgroundColor_ = nil;
-
- [super dealloc];
+ cornerBackgroundColor_ = nil;
}
@@ -238,8 +236,7 @@ - (void)setCornersPosition:(MGCornersPosition)posn
- (void)setCornerBackgroundColor:(UIColor *)color
{
if (color != cornerBackgroundColor_) {
- [cornerBackgroundColor_ release];
- cornerBackgroundColor_ = [color retain];
+ cornerBackgroundColor_ = color;
[self setNeedsDisplay];
}
}
View
4 Classes/MGSplitDividerView.m
@@ -30,9 +30,7 @@ - (id)initWithFrame:(CGRect)frame
- (void)dealloc
{
- self.splitViewController_ = nil;
-
- [super dealloc];
+ splitViewController_ = nil;
}
View
28 Classes/MGSplitViewController.m
@@ -149,13 +149,6 @@ - (void)dealloc
{
_delegate = nil;
[self.view.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
- [_viewControllers release];
- [_barButtonItem release];
- [_hiddenPopoverController release];
- [_dividerView release];
- [_cornerViews release];
-
- [super dealloc];
}
@@ -437,9 +430,7 @@ - (void)layoutSubviewsForInterfaceOrientation:(UIInterfaceOrientation)theOrienta
trailingCorners.cornerBackgroundColor = MG_DEFAULT_CORNER_COLOR;
trailingCorners.cornerRadius = MG_DEFAULT_CORNER_RADIUS;
_cornerViews = [[NSArray alloc] initWithObjects:leadingCorners, trailingCorners, nil];
- [leadingCorners release];
- [trailingCorners release];
-
+
} else if ([_cornerViews count] == 2) {
leadingCorners = [_cornerViews objectAtIndex:0];
trailingCorners = [_cornerViews objectAtIndex:1];
@@ -559,7 +550,6 @@ - (void)reconfigureForMasterInPopover:(BOOL)inPopover
if (inPopover && !_hiddenPopoverController && !_barButtonItem) {
// Create and configure popover for our masterViewController.
- [_hiddenPopoverController release];
_hiddenPopoverController = nil;
[self.masterViewController viewWillDisappear:NO];
_hiddenPopoverController = [[UIPopoverController alloc] initWithContentViewController:self.masterViewController];
@@ -585,7 +575,6 @@ - (void)reconfigureForMasterInPopover:(BOOL)inPopover
// Remove master from popover and destroy popover, if it exists.
[_hiddenPopoverController dismissPopoverAnimated:NO];
- [_hiddenPopoverController release];
_hiddenPopoverController = nil;
// Inform delegate that the _barButtonItem will become invalid.
@@ -596,7 +585,6 @@ - (void)reconfigureForMasterInPopover:(BOOL)inPopover
}
// Destroy _barButtonItem.
- [_barButtonItem release];
_barButtonItem = nil;
// Move master view.
@@ -911,7 +899,7 @@ - (void)setSplitWidth:(float)width
- (NSArray *)viewControllers
{
- return [[_viewControllers copy] autorelease];
+ return [_viewControllers copy];
}
@@ -923,7 +911,6 @@ - (void)setViewControllers:(NSArray *)controllers
[controller.view removeFromSuperview];
}
}
- [_viewControllers release];
_viewControllers = [[NSMutableArray alloc] initWithCapacity:2];
if (controllers && [controllers count] >= 2) {
self.masterViewController = [controllers objectAtIndex:0];
@@ -942,7 +929,7 @@ - (UIViewController *)masterViewController
if (_viewControllers && [_viewControllers count] > 0) {
NSObject *controller = [_viewControllers objectAtIndex:0];
if ([controller isKindOfClass:[UIViewController class]]) {
- return [[controller retain] autorelease];
+ return (UIViewController *)controller;
}
}
@@ -984,7 +971,7 @@ - (UIViewController *)detailViewController
if (_viewControllers && [_viewControllers count] > 1) {
NSObject *controller = [_viewControllers objectAtIndex:1];
if ([controller isKindOfClass:[UIViewController class]]) {
- return [[controller retain] autorelease];
+ return (UIViewController *)controller;
}
}
@@ -1020,7 +1007,7 @@ - (void)setDetailViewController:(UIViewController *)detail
- (MGSplitDividerView *)dividerView
{
- return [[_dividerView retain] autorelease];
+ return _dividerView;
}
@@ -1028,8 +1015,7 @@ - (void)setDividerView:(MGSplitDividerView *)divider
{
if (divider != _dividerView) {
[_dividerView removeFromSuperview];
- [_dividerView release];
- _dividerView = [divider retain];
+ _dividerView = divider;
_dividerView.splitViewController = self;
_dividerView.backgroundColor = MG_DEFAULT_CORNER_COLOR;
if ([self isShowingMaster]) {
@@ -1114,7 +1100,7 @@ - (void)setDividerStyle:(MGSplitViewDividerStyle)newStyle animated:(BOOL)animate
- (NSArray *)cornerViews
{
if (_cornerViews) {
- return [[_cornerViews retain] autorelease];
+ return _cornerViews;
}
return nil;

0 comments on commit d22a5a9

Please sign in to comment.
Something went wrong with that request. Please try again.