Skip to content

Upgrade StackScrollView to ARC #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Classes/DataViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@
- (id)initWithFrame:(CGRect)frame;


@property(nonatomic, retain)UITableView* tableView;
@property(nonatomic, strong)UITableView* tableView;

@end
7 changes: 1 addition & 6 deletions Classes/DataViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ - (id)initWithFrame:(CGRect)frame {

UIView* footerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 1)];
_tableView.tableFooterView = footerView;
[footerView release];

[_tableView setAutoresizingMask:UIViewAutoresizingFlexibleHeight];
[self.view addSubview:_tableView];
Expand Down Expand Up @@ -105,7 +104,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}

// Configure the cell...
Expand All @@ -122,7 +121,6 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
DataViewController *dataViewController = [[DataViewController alloc] initWithFrame:CGRectMake(0, 0, 477, self.view.frame.size.height)];
[[StackScrollViewAppDelegate instance].rootViewController.stackScrollViewController addViewInSlider:dataViewController invokeByController:self isStackStartView:FALSE];
[dataViewController release];
}


Expand All @@ -137,9 +135,6 @@ - (void)viewDidUnload {
}


- (void)dealloc {
[super dealloc];
}


@end
Expand Down
2 changes: 1 addition & 1 deletion Classes/MenuViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@
}
- (id)initWithFrame:(CGRect)frame;

@property(nonatomic, retain)UITableView* tableView;
@property(nonatomic, strong)UITableView* tableView;

@end
11 changes: 2 additions & 9 deletions Classes/MenuViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ - (id)initWithFrame:(CGRect)frame {

UIView* footerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 1)];
_tableView.tableFooterView = footerView;
[footerView release];

[self.view addSubview:_tableView];

Expand All @@ -69,7 +68,6 @@ - (id)initWithFrame:(CGRect)frame {
[verticalLineView setBackgroundColor:[UIColor whiteColor]];
[self.view addSubview:verticalLineView];
[self.view bringSubviewToFront:verticalLineView];
[verticalLineView release];

}
return self;
Expand Down Expand Up @@ -121,8 +119,8 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
UIView* bgView = [[[UIView alloc] init] autorelease];
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
UIView* bgView = [[UIView alloc] init];
[bgView setBackgroundColor:[UIColor colorWithWhite:2 alpha:0.2]];
[cell setSelectedBackgroundView:bgView];
}
Expand All @@ -142,7 +140,6 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
DataViewController *dataViewController = [[DataViewController alloc] initWithFrame:CGRectMake(0, 0, 477, self.view.frame.size.height)];
[[StackScrollViewAppDelegate instance].rootViewController.stackScrollViewController addViewInSlider:dataViewController invokeByController:self isStackStartView:TRUE];
[dataViewController release];
}


Expand All @@ -157,10 +154,6 @@ - (void)viewDidUnload {
}


- (void)dealloc {
[_tableView release];
[super dealloc];
}


@end
Expand Down
4 changes: 2 additions & 2 deletions Classes/RootViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@

}

@property (nonatomic, retain) MenuViewController* menuViewController;
@property (nonatomic, retain) StackScrollViewController* stackScrollViewController;
@property (nonatomic, strong) MenuViewController* menuViewController;
@property (nonatomic, strong) StackScrollViewController* stackScrollViewController;


@end
5 changes: 0 additions & 5 deletions Classes/RootViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,4 @@ - (void)viewDidUnload {
[super viewDidUnload];
}


- (void)dealloc {
[super dealloc];
}

@end
4 changes: 2 additions & 2 deletions Classes/StackScrollViewAppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@

+ (StackScrollViewAppDelegate *) instance;

@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) RootViewController *rootViewController;
@property (nonatomic, strong) IBOutlet UIWindow *window;
@property (nonatomic, strong) RootViewController *rootViewController;

@end

5 changes: 0 additions & 5 deletions Classes/StackScrollViewAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,6 @@ Free up as much memory as possible by purging cached data objects that can be re
}


- (void)dealloc {
[rootViewController release];
[window release];
[super dealloc];
}


@end
8 changes: 4 additions & 4 deletions Classes/StackScrollViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
// Created by Reefaq Mohammed Mac Pro on 5/10/11.
// Copyright 2011 raw engineering. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>


Expand Down Expand Up @@ -70,10 +70,10 @@
- (void) addViewInSlider:(UIViewController*)controller invokeByController:(UIViewController*)invokeByController isStackStartView:(BOOL)isStackStartView;
- (void)bounceBack:(NSString*)animationID finished:(NSNumber*)finished context:(void*)context;

@property (nonatomic, retain) UIView* slideViews;
@property (nonatomic, retain) UIView* borderViews;
@property (nonatomic, strong) UIView* slideViews;
@property (nonatomic, strong) UIView* borderViews;
@property (nonatomic, assign) CGFloat slideStartPosition;
@property (nonatomic, assign) NSMutableArray* viewControllersStack;
@property (nonatomic) NSMutableArray* viewControllersStack;



Expand Down
14 changes: 4 additions & 10 deletions Classes/StackScrollViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
//

#import "StackScrollViewController.h"
#import "UIViewWithShadow.h";
#import "UIViewWithShadow.h"

const NSInteger SLIDE_VIEWS_MINUS_X_POSITION = -130;
const NSInteger SLIDE_VIEWS_START_X_POS = 0;
Expand All @@ -53,13 +53,13 @@ -(id)init {
viewControllersStack = [[NSMutableArray alloc] init];
borderViews = [[UIView alloc] initWithFrame:CGRectMake(SLIDE_VIEWS_MINUS_X_POSITION - 2, -2, 2, self.view.frame.size.height)];
[borderViews setBackgroundColor:[UIColor clearColor]];
UIView* verticalLineView1 = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, 1, borderViews.frame.size.height)] autorelease];
UIView* verticalLineView1 = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 1, borderViews.frame.size.height)];
[verticalLineView1 setBackgroundColor:[UIColor whiteColor]];
[verticalLineView1 setTag:1];
[verticalLineView1 setHidden:TRUE];
[borderViews addSubview:verticalLineView1];

UIView* verticalLineView2 = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, 2, borderViews.frame.size.height)] autorelease];
UIView* verticalLineView2 = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 2, borderViews.frame.size.height)];
[verticalLineView2 setBackgroundColor:[UIColor grayColor]];
[verticalLineView2 setTag:2];
[verticalLineView2 setHidden:TRUE];
Expand Down Expand Up @@ -90,7 +90,6 @@ -(id)init {
[panRecognizer setDelaysTouchesEnded:TRUE];
[panRecognizer setCancelsTouchesInView:TRUE];
[self.view addGestureRecognizer:panRecognizer];
[panRecognizer release];

[self.view addSubview:slideViews];

Expand Down Expand Up @@ -693,7 +692,7 @@ - (void)addViewInSlider:(UIViewController*)controller invokeByController:(UIView
}

if ([slideViews.subviews count] != 0) {
UIViewWithShadow* verticalLineView = [[[UIViewWithShadow alloc] initWithFrame:CGRectMake(-40, 0, 40 , self.view.frame.size.height)] autorelease];
UIViewWithShadow* verticalLineView = [[UIViewWithShadow alloc] initWithFrame:CGRectMake(-40, 0, 40 , self.view.frame.size.height)];
[verticalLineView setBackgroundColor:[UIColor clearColor]];
[verticalLineView setAutoresizingMask:UIViewAutoresizingFlexibleHeight];
[verticalLineView setClipsToBounds:NO];
Expand Down Expand Up @@ -856,11 +855,6 @@ - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceO
}
}

- (void)dealloc {
[slideViews release];
[viewControllersStack release];
[super dealloc];
}


@end
6 changes: 4 additions & 2 deletions StackScrollView.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -224,13 +224,14 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ENABLE_OBJC_ARC = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Don't Code Sign";
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = StackScrollView_Prefix.pch;
GCC_VERSION = com.apple.compilers.llvmgcc42;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
INFOPLIST_FILE = "StackScrollView-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 3.2;
PRODUCT_NAME = StackScrollView;
Expand All @@ -242,10 +243,11 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ENABLE_OBJC_ARC = YES;
COPY_PHASE_STRIP = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = StackScrollView_Prefix.pch;
GCC_VERSION = com.apple.compilers.llvmgcc42;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
INFOPLIST_FILE = "StackScrollView-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 3.2;
PRODUCT_NAME = StackScrollView;
Expand Down
8 changes: 4 additions & 4 deletions main.m
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@

int main(int argc, char *argv[]) {

NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, nil);
[pool release];
return retVal;
@autoreleasepool {
int retVal = UIApplicationMain(argc, argv, nil, nil);
return retVal;
}
}