Skip to content
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

Converted project to ARC. Added .gitignore #13

Open
wants to merge 2 commits into
base: develop
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
build
_local
xcuserdata
14 changes: 7 additions & 7 deletions APSplitSample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

/* Begin PBXBuildFile section */
F9098276136DA60000C99CF5 /* SimpleSplitController.m in Sources */ = {isa = PBXBuildFile; fileRef = F9098270136DA60000C99CF5 /* SimpleSplitController.m */; };
F9098289136DA63000C99CF5 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = F9098287136DA63000C99CF5 /* InfoPlist.strings */; };
F909828C136DA64400C99CF5 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = F909828A136DA64400C99CF5 /* MainWindow.xib */; };
F90C9083137335070094FB26 /* APNavigationControllerForSplitController.m in Sources */ = {isa = PBXBuildFile; fileRef = F90C9082137335070094FB26 /* APNavigationControllerForSplitController.m */; };
F93A8175136EB11200BAA65A /* Icon72.png in Resources */ = {isa = PBXBuildFile; fileRef = F93A8174136EB11200BAA65A /* Icon72.png */; };
Expand All @@ -20,14 +19,13 @@
F9C811BD136D956D00505A8E /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F9C811BC136D956D00505A8E /* CoreGraphics.framework */; };
F9C811C6136D956E00505A8E /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = F9C811C5136D956E00505A8E /* main.m */; };
F9C811C9136D956E00505A8E /* SplitSampleAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = F9C811C8136D956E00505A8E /* SplitSampleAppDelegate.m */; };
F9E72E5E136DA99900CD71CC /* APSplitSample-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = F9E72E5D136DA99900CD71CC /* APSplitSample-Info.plist */; };
F9FDD3E6136DD23200FA3428 /* APSplitViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F9FDD3E1136DD23200FA3428 /* APSplitViewController.m */; };
F9FDD3E7136DD23200FA3428 /* APTabBarControllerForSplitController.m in Sources */ = {isa = PBXBuildFile; fileRef = F9FDD3E3136DD23200FA3428 /* APTabBarControllerForSplitController.m */; };
F9FDD3E8136DD23200FA3428 /* split-divider.png in Resources */ = {isa = PBXBuildFile; fileRef = F9FDD3E5136DD23200FA3428 /* split-divider.png */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
F909826F136DA60000C99CF5 /* SimpleSplitController.h */ = {isa = PBXFileReference; fileEncoding = 4; path = SimpleSplitController.h; sourceTree = "<group>"; };
F909826F136DA60000C99CF5 /* SimpleSplitController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimpleSplitController.h; sourceTree = "<group>"; };
F9098270136DA60000C99CF5 /* SimpleSplitController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SimpleSplitController.m; sourceTree = "<group>"; };
F9098288136DA63000C99CF5 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
F909828B136DA64400C99CF5 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainWindow.xib; sourceTree = "<group>"; };
Expand All @@ -37,7 +35,7 @@
F93A8176136EB85500BAA65A /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README.md; sourceTree = "<group>"; };
F965505413727B04001F7E4B /* ColorListMasterController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ColorListMasterController.h; sourceTree = "<group>"; };
F965505513727B04001F7E4B /* ColorListMasterController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ColorListMasterController.m; sourceTree = "<group>"; };
F965505913728D3C001F7E4B /* MasterDetailSplitController.h */ = {isa = PBXFileReference; fileEncoding = 4; path = MasterDetailSplitController.h; sourceTree = "<group>"; };
F965505913728D3C001F7E4B /* MasterDetailSplitController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MasterDetailSplitController.h; sourceTree = "<group>"; };
F965505A13728D3C001F7E4B /* MasterDetailSplitController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MasterDetailSplitController.m; sourceTree = "<group>"; };
F9C811B4136D956D00505A8E /* APSplitSample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = APSplitSample.app; sourceTree = BUILT_PRODUCTS_DIR; };
F9C811B8136D956D00505A8E /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
Expand Down Expand Up @@ -72,7 +70,7 @@
F909826C136DA60000C99CF5 /* Classes */ = {
isa = PBXGroup;
children = (
F965505C1372927E001F7E4B /* Simple Split */,
F965505C1372927E001F7E4B /* Two Sides Split */,
F965505D13729295001F7E4B /* Master–Detail Split */,
);
path = Classes;
Expand Down Expand Up @@ -220,9 +218,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
F9098289136DA63000C99CF5 /* InfoPlist.strings in Resources */,
F909828C136DA64400C99CF5 /* MainWindow.xib in Resources */,
F9E72E5E136DA99900CD71CC /* APSplitSample-Info.plist in Resources */,
F9FDD3E8136DD23200FA3428 /* split-divider.png in Resources */,
F93A8175136EB11200BAA65A /* Icon72.png in Resources */,
F93A8177136EB85500BAA65A /* README.md in Resources */,
Expand Down Expand Up @@ -307,10 +303,12 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ENABLE_OBJC_ARC = YES;
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "SplitSample/APSplitSample-Prefix.pch";
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
INFOPLIST_FILE = "SplitSample/APSplitSample-Info.plist";
PRODUCT_NAME = APSplitSample;
WRAPPER_EXTENSION = app;
Expand All @@ -321,9 +319,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 = "SplitSample/APSplitSample-Prefix.pch";
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
INFOPLIST_FILE = "SplitSample/APSplitSample-Info.plist";
PRODUCT_NAME = APSplitSample;
VALIDATE_PRODUCT = YES;
Expand Down
2 changes: 1 addition & 1 deletion Split/APNavigationControllerForSplitController.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
@interface APNavigationControllerForSplitController : UINavigationController {
}

@property (nonatomic, readonly) id<APSplitViewDelegate> splitDelegate;
@property (unsafe_unretained, nonatomic, readonly) id<APSplitViewDelegate> splitDelegate;

- (id)initWithSplit:(id<APSplitViewDelegate>)splitDelegate;

Expand Down
5 changes: 0 additions & 5 deletions Split/APNavigationControllerForSplitController.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ - (id)initWithSplit:(id<APSplitViewDelegate>)splitDelegate {
return self;
}

- (void)dealloc {
_splitDelegate = nil;
[super dealloc];
}

#pragma mark - Overwrite methods

- (UIViewController *)popViewControllerAnimated:(BOOL)animated {
Expand Down
14 changes: 0 additions & 14 deletions Split/APSplitViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,6 @@ - (void) layoutSubviews {
_divider.frame = CGRectMake(constMasterWidth, 0, constDividerWidth, size.height);
}

- (void) dealloc {

[_master release];
[_detail release];
[super dealloc];
}

#pragma mark - View lifecycle

- (void) pushToMasterController:(UIViewController *)controller {
Expand Down Expand Up @@ -132,7 +125,6 @@ - (void) loadView {
UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
imageView.frame = CGRectMake(-4, 0, image.size.width, image.size.height);
[_divider addSubview:imageView];
[imageView release];
}

- (void) viewDidLoad {
Expand All @@ -152,12 +144,6 @@ - (void) viewDidLoad {
// NSLog(@"_detail.view.frame: %@", NSStringFromCGRect(_detail.view.frame));
}

- (void) viewDidUnload {

[_master release], _master = nil;
[_detail release], _detail = nil;
}

#pragma mark -
#pragma mark STANDARD METHODS

Expand Down
2 changes: 1 addition & 1 deletion SplitSample/Classes/ColorListMasterController.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
APSplitViewController *_split;
}

@property (nonatomic, readonly) UIViewController *detailViewController;
@property (unsafe_unretained, nonatomic, readonly) UIViewController *detailViewController;
@property (nonatomic, readonly) NSMutableArray *colorList;

- (id)initWithSplit:(APSplitViewController*)split;
Expand Down
20 changes: 6 additions & 14 deletions SplitSample/Classes/ColorListMasterController.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ - (id)initWithSplit:(APSplitViewController*)split
self = [super initWithStyle:UITableViewStylePlain];
if (self) {

_split = [split retain];
_split = split;

// init detail
_detailViewController = [[self randomViewController] retain];
_detailViewController = [self randomViewController];
_detailViewController.title = @"Detail root";
[_split pushToDetailController:self.detailViewController];

Expand All @@ -37,13 +37,6 @@ - (id)initWithSplit:(APSplitViewController*)split
return self;
}

- (void)dealloc
{
[_split release];
[_detailViewController release];
[_colorList release];
[super dealloc];
}

- (void)didReceiveMemoryWarning
{
Expand All @@ -59,10 +52,10 @@ - (void)viewDidLoad
{
[super viewDidLoad];

self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithTitle:@"Push"
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Push"
style:UIBarButtonItemStyleBordered
target:self
action:@selector(buttonPushRandomViewController)] autorelease];
action:@selector(buttonPushRandomViewController)];
}

- (void)viewDidUnload
Expand All @@ -71,7 +64,6 @@ - (void)viewDidUnload
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;

[_detailViewController release];
_detailViewController = nil;
}

Expand Down Expand Up @@ -119,7 +111,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];
cell.selectionStyle = UITableViewCellSelectionStyleGray;
}

Expand Down Expand Up @@ -178,7 +170,7 @@ - (UIColor *)randomColor {
- (UIViewController*)randomViewController {
UIViewController *viewController = [[UIViewController alloc] init];
viewController.view.backgroundColor = [self randomColor];
return [viewController autorelease];
return viewController;
}

- (void) buttonPushRandomViewController {
Expand Down
5 changes: 0 additions & 5 deletions SplitSample/Classes/MasterDetailSplitController.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ @implementation MasterDetailSplitController

@synthesize masterViewController = _masterViewController;

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

#pragma mark - View lifecycle

Expand All @@ -30,7 +26,6 @@ - (void)viewDidLoad {
- (void)viewDidUnload {
[super viewDidUnload];

[_masterViewController release];
_masterViewController = nil;
}

Expand Down
4 changes: 2 additions & 2 deletions SplitSample/Classes/SimpleSplitController.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
@interface SimpleSplitController : APSplitViewController {
}

@property (nonatomic, retain) UIViewController *left;
@property (nonatomic, retain) UIViewController *right;
@property (nonatomic, strong) UIViewController *left;
@property (nonatomic, strong) UIViewController *right;

@end
18 changes: 6 additions & 12 deletions SplitSample/Classes/SimpleSplitController.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@ @implementation SimpleSplitController

@synthesize left, right;

- (void)dealloc {
self.left = nil;
self.right = nil;

[super dealloc];
}

#pragma mark - View lifecycle

Expand Down Expand Up @@ -61,22 +55,22 @@ - (UIColor *) randomColor {
- (UIViewController*) randomViewController1 {
UIViewController *viewController = [[UIViewController alloc] init];
viewController.view.backgroundColor = [self randomColor];
viewController.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithTitle:@"Push"
viewController.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Push"
style:UIBarButtonItemStyleBordered
target:self
action:@selector(buttonPushRandomViewController1)] autorelease];
action:@selector(buttonPushRandomViewController1)];

return [viewController autorelease];
return viewController;
}

- (UIViewController*) randomViewController2 {
UIViewController *viewController = [[UIViewController alloc] init];
viewController.view.backgroundColor = [self randomColor];
viewController.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithTitle:@"Push"
viewController.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Push"
style:UIBarButtonItemStyleBordered
target:self
action:@selector(buttonPushRandomViewController2)] autorelease];
return [viewController autorelease];
action:@selector(buttonPushRandomViewController2)];
return viewController;
}

- (void) buttonPushRandomViewController1 {
Expand Down
4 changes: 2 additions & 2 deletions SplitSample/SplitSampleAppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

}

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

@property (nonatomic, retain) IBOutlet APTabBarControllerForSplitController *tabBarController;
@property (nonatomic, strong) IBOutlet APTabBarControllerForSplitController *tabBarController;

@end
5 changes: 0 additions & 5 deletions SplitSample/SplitSampleAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,6 @@ - (void)applicationWillTerminate:(UIApplication *)application {
*/
}

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

/*
// Optional UITabBarControllerDelegate method.
Expand Down
8 changes: 4 additions & 4 deletions SplitSample/main.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,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;
}
}