Permalink
Browse files

Initial pass at ARC'ing. Deployment target bumped to 6.0

  • Loading branch information...
1 parent 2dea262 commit 778b3f48523508ff5b34d886e034b69d84ad7ee2 @davidmorford committed Apr 2, 2013
Showing with 66 additions and 109 deletions.
  1. +1 −1 Configurations/DeploymentTarget.xcconfig
  2. +2 −2 Projects/Applications/TabBarKitCatalog/Source/Classes/ApplicationDelegate/TBKCApplicationDelegate.h
  3. +12 −13 Projects/Applications/TabBarKitCatalog/Source/Classes/ApplicationDelegate/TBKCApplicationDelegate.m
  4. +0 −3 Projects/Applications/TabBarKitCatalog/Source/Classes/Controllers/TBKCContentViewController.m
  5. +1 −5 Projects/Applications/TabBarKitCatalog/Source/Classes/Controllers/TBKCDetailViewController.m
  6. +1 −4 Projects/Applications/TabBarKitCatalog/Source/Classes/Controllers/TBKCImagesViewController.m
  7. +1 −5 Projects/Applications/TabBarKitCatalog/Source/Classes/Controllers/TBKCMasterViewController.m
  8. +1 −5 Projects/Applications/TabBarKitCatalog/Source/Classes/Controllers/TBKCMoviesViewController.m
  9. +1 −4 Projects/Applications/TabBarKitCatalog/Source/Classes/Controllers/TBKCSettingsViewController.m
  10. +4 −4 Projects/Applications/TabBarKitCatalog/Source/Project/main.m
  11. +4 −0 Projects/Applications/TabBarKitCatalog/TabBarKitCatalog.xcodeproj/project.pbxproj
  12. +3 −3 Projects/Libraries/TabBarKit/Source/Categories/NSObject+TBKAssociatedObject.m
  13. +2 −2 Projects/Libraries/TabBarKit/Source/Categories/UIImage+TBKMasking.m
  14. +3 −3 Projects/Libraries/TabBarKit/Source/Classes/TBKTabBar.h
  15. +2 −10 Projects/Libraries/TabBarKit/Source/Classes/TBKTabBar.m
  16. +5 −5 Projects/Libraries/TabBarKit/Source/Classes/TBKTabBarController.h
  17. +11 −22 Projects/Libraries/TabBarKit/Source/Classes/TBKTabBarController.m
  18. +8 −18 Projects/Libraries/TabBarKit/Source/Classes/TBKTabBarItem.m
  19. +4 −0 Projects/Libraries/TabBarKit/TabBarKit.xcodeproj/project.pbxproj
@@ -3,4 +3,4 @@
// DeploymentTarget.xcconfig
//
-IPHONEOS_DEPLOYMENT_TARGET = 4.2 //latest_iphoneos
+IPHONEOS_DEPLOYMENT_TARGET = 6.0
@@ -20,8 +20,8 @@
*/
@interface TBKCApplicationDelegate : NSObject <UIApplicationDelegate, TBKTabBarControllerDelegate>
-@property (nonatomic, retain) UIWindow *window;
-@property (nonatomic, retain) TBKTabBarController *tabBarController;
+@property (nonatomic, strong) UIWindow *window;
+@property (nonatomic, strong) TBKTabBarController *tabBarController;
#pragma mark -
@@ -33,23 +33,23 @@ -(BOOL) application:(UIApplication *)application didFinishLaunchingWithOptions:(
tabBarController = [[TBKTabBarController alloc] initWithStyle:TBKTabBarStyleDefault];
tabBarController.delegate = self;
tabBarController.viewControllers = [NSArray arrayWithObjects:
- [[[UINavigationController alloc] initWithRootViewController:[[[TBKCMasterViewController alloc] init] autorelease]] autorelease],
- [[[UINavigationController alloc] initWithRootViewController:[[[TBKCDetailViewController alloc] init] autorelease]] autorelease],
- [[[UINavigationController alloc] initWithRootViewController:[[[TBKCImagesViewController alloc] init] autorelease]] autorelease],
- [[[UINavigationController alloc] initWithRootViewController:[[[TBKCSettingsViewController alloc] init] autorelease]] autorelease],
- [[[UINavigationController alloc] initWithRootViewController:[[[TBKCMoviesViewController alloc] init] autorelease]] autorelease],
+ [[UINavigationController alloc] initWithRootViewController:[[TBKCMasterViewController alloc] init]],
+ [[UINavigationController alloc] initWithRootViewController:[[TBKCDetailViewController alloc] init]],
+ [[UINavigationController alloc] initWithRootViewController:[[TBKCImagesViewController alloc] init]],
+ [[UINavigationController alloc] initWithRootViewController:[[TBKCSettingsViewController alloc] init]],
+ [[UINavigationController alloc] initWithRootViewController:[[TBKCMoviesViewController alloc] init]],
nil];
window.rootViewController = self.tabBarController;
}
else if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
tabBarController = [[TBKTabBarController alloc] initWithStyle:TBKTabBarStyleArrowIndicator];
tabBarController.delegate = self;
tabBarController.viewControllers = [NSArray arrayWithObjects:
- [[[UINavigationController alloc] initWithRootViewController:[[[TBKCMasterViewController alloc] init] autorelease]] autorelease],
- [[[UINavigationController alloc] initWithRootViewController:[[[TBKCDetailViewController alloc] init] autorelease]] autorelease],
- [[[UINavigationController alloc] initWithRootViewController:[[[TBKCImagesViewController alloc] init] autorelease]] autorelease],
- [[[UINavigationController alloc] initWithRootViewController:[[[TBKCSettingsViewController alloc] init] autorelease]] autorelease],
- [[[UINavigationController alloc] initWithRootViewController:[[[TBKCMoviesViewController alloc] init] autorelease]] autorelease],
+ [[UINavigationController alloc] initWithRootViewController:[[TBKCMasterViewController alloc] init]],
+ [[UINavigationController alloc] initWithRootViewController:[[TBKCDetailViewController alloc] init]],
+ [[UINavigationController alloc] initWithRootViewController:[[TBKCImagesViewController alloc] init]],
+ [[UINavigationController alloc] initWithRootViewController:[[TBKCSettingsViewController alloc] init]],
+ [[UINavigationController alloc] initWithRootViewController:[[TBKCMoviesViewController alloc] init]],
nil];
window.rootViewController = self.tabBarController;
}
@@ -66,9 +66,8 @@ -(void) tabBarController:(TBKTabBarController *)tbc didSelectViewController:(UIV
#pragma mark Memory
-(void) dealloc {
- [tabBarController release], tabBarController = nil;
- [window release], window = nil;
- [super dealloc];
+ tabBarController = nil;
+ window = nil;
}
@end
@@ -38,8 +38,5 @@ -(void) didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
}
--(void) dealloc {
- [super dealloc];
-}
@end
@@ -44,7 +44,7 @@ -(UITableViewCell *) tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexP
static NSString *CellIdentifier = @"CellIdentifier";
UITableViewCell *cell = [tv dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
- cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
+ cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
cell.accessoryType = UITableViewCellAccessoryNone;
}
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
@@ -59,7 +59,6 @@ -(void) tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath
[aTableView deselectRowAtIndexPath:indexPath animated:YES];
TBKCContentViewController *contentViewController = [[TBKCContentViewController alloc] init];
[self.navigationController pushViewController:contentViewController animated:TRUE];
- [contentViewController release];
}
@@ -73,8 +72,5 @@ -(void) didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
}
--(void) dealloc {
- [super dealloc];
-}
@end
@@ -44,7 +44,7 @@ -(UITableViewCell *) tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexP
static NSString *CellIdentifier = @"CellIdentifier";
UITableViewCell *cell = [tv dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
- cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
+ cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
cell.accessoryType = UITableViewCellAccessoryNone;
}
cell.textLabel.text = [NSString stringWithFormat:@"Settings %d", anIndexPath.row];
@@ -62,8 +62,5 @@ -(void) didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
}
--(void) dealloc {
- [super dealloc];
-}
@end
@@ -44,7 +44,7 @@ -(UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
static NSString *CellIdentifier = @"CellIdentifier";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
- cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
+ cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
cell.accessoryType = UITableViewCellAccessoryNone;
}
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
@@ -60,7 +60,6 @@ -(void) tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath
TBKCContentViewController *contentViewController = [[TBKCContentViewController alloc] init];
contentViewController.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:contentViewController animated:TRUE];
- [contentViewController release];
}
@@ -74,8 +73,5 @@ -(void) didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
}
--(void) dealloc {
- [super dealloc];
-}
@end
@@ -45,7 +45,7 @@ -(UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
static NSString *CellIdentifier = @"CellIdentifier";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
- cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
+ cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
cell.accessoryType = UITableViewCellAccessoryNone;
}
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
@@ -61,7 +61,6 @@ -(void) tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath
TBKCContentViewController *contentViewController = [[TBKCContentViewController alloc] init];
contentViewController.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:contentViewController animated:TRUE];
- [contentViewController release];
}
@@ -75,8 +74,5 @@ -(void) didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
}
--(void) dealloc {
- [super dealloc];
-}
@end
@@ -48,7 +48,7 @@ -(UITableViewCell *) tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexP
static NSString *CellIdentifier = @"CellIdentifier";
UITableViewCell *cell = [tv dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
- cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
+ cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
cell.accessoryType = UITableViewCellAccessoryNone;
}
cell.textLabel.text = [NSString stringWithFormat:@"Settings %d", anIndexPath.row];
@@ -65,8 +65,5 @@ -(void) viewDidUnload {
[super viewDidUnload];
}
--(void) dealloc {
- [super dealloc];
-}
@end
@@ -10,8 +10,8 @@
int
main(int argc, char *argv[]) {
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- int retVal = UIApplicationMain(argc, argv, nil, @"TBKCApplicationDelegate");
- [pool release];
- return retVal;
+ @autoreleasepool {
+ int retVal = UIApplicationMain(argc, argv, nil, @"TBKCApplicationDelegate");
+ return retVal;
+ }
}
@@ -482,13 +482,17 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 63F7E3DA137656490053B106 /* Debug.xcconfig */;
buildSettings = {
+ CLANG_ENABLE_OBJC_ARC = YES;
+ SDKROOT = iphoneos;
};
name = Debug;
};
1D6058950D05DD3E006BFB54 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 63F7E3DB137656490053B106 /* Release.xcconfig */;
buildSettings = {
+ CLANG_ENABLE_OBJC_ARC = YES;
+ SDKROOT = iphoneos;
};
name = Release;
};
@@ -4,15 +4,15 @@
@implementation NSObject (TBKAssociatedObject)
-(void) associateValue:(id)aValue withKey:(NSString *)aKey {
- objc_setAssociatedObject(self, aKey, aValue, TBKAssociationPolicyRetainNonatomic);
+ objc_setAssociatedObject(self, [aKey cStringUsingEncoding:NSUTF8StringEncoding], aValue, TBKAssociationPolicyRetainNonatomic);
}
-(void) associateValue:(id)aValue withKey:(NSString *)aKey policy:(TBKAssociationPolicy)aPolicy;{
- objc_setAssociatedObject(self, aKey, aValue, aPolicy);
+ objc_setAssociatedObject(self, [aKey cStringUsingEncoding:NSUTF8StringEncoding], aValue, aPolicy);
}
-(id) associatedValueForKey:(NSString *)aKey {
- return objc_getAssociatedObject(self, aKey);
+ return objc_getAssociatedObject(self, [aKey cStringUsingEncoding:NSUTF8StringEncoding]);
}
-(void) removeAssociatedValueForKey:(NSString *)aKey {
@@ -51,8 +51,8 @@ -(UIImage *) imageMaskedWithColors:(NSArray *)aColorList opacity:(CGFloat)anOpac
[ar addObject:(id)c.CGColor];
}
CGColorSpaceRef space = CGBitmapContextGetColorSpace(context);
- CGGradientRef gradient = CGGradientCreateWithColors(space, (CFArrayRef)ar, NULL);
- CGContextDrawLinearGradient(context,
+ CGGradientRef gradient = CGGradientCreateWithColors(space, (__bridge CFArrayRef)ar, NULL);
+ CGContextDrawLinearGradient(context,
gradient,
CGPointMake(rect.origin.x, rect.origin.y + rect.size.height), //BUGBUG: Flip?
CGPointMake(rect.origin.x, rect.origin.y),
@@ -25,9 +25,9 @@ enum {
*/
@interface TBKTabBar : UIView
-@property (nonatomic, assign) id <TBKTabBarDelegate> delegate;
-@property (nonatomic, retain) NSArray *items;
-@property (nonatomic, retain) TBKTabBarItem *selectedTabBarItem;
+@property (nonatomic, weak) id <TBKTabBarDelegate> delegate;
+@property (nonatomic, strong) NSArray *items;
+@property (nonatomic, strong) TBKTabBarItem *selectedTabBarItem;
@property (nonatomic, assign) TBKTabBarStyle tabBarStyle;
@@ -28,16 +28,13 @@ -(id) init {
return self;
}
--(void) dealloc {
- [super dealloc];
-}
@end
#pragma mark -
@interface TBKTabBar ()
-@property (nonatomic, assign) TBKArrowLayer *arrowLayer;
+@property (nonatomic, strong) TBKArrowLayer *arrowLayer;
@property (nonatomic, assign) CGFloat tabMargin;
-(void) setArrowPositionAnimated:(BOOL)animated;
@end
@@ -114,8 +111,7 @@ -(void) setItems:(NSArray *)aTabBarItemArray {
[tabBarItem removeFromSuperview];
}
- [items release];
- items = [aTabBarItemArray retain];
+ items = aTabBarItemArray;
if ([items count]) {
[(TBKTabBarItem *)[items objectAtIndex:0] setSelected:YES];
@@ -207,11 +203,7 @@ -(BOOL) isCustomizing {
#pragma mark Memory
-(void) dealloc {
- self.arrowLayer = nil;
self.delegate = nil;
- self.selectedTabBarItem = nil;
- self.items = nil;
- [super dealloc];
}
@end
@@ -19,15 +19,15 @@
*/
@interface TBKTabBarController : UIViewController <TBKTabBarDelegate>
-@property (nonatomic, assign) id <TBKTabBarControllerDelegate> delegate;
+@property (nonatomic, weak) id <TBKTabBarControllerDelegate> delegate;
-@property (nonatomic, retain) TBKTabBar *tabBar;
+@property (nonatomic, strong) TBKTabBar *tabBar;
@property (nonatomic, assign) NSUInteger selectedIndex;
-@property (nonatomic, retain) NSArray *viewControllers;
-@property (nonatomic, retain) UIViewController *selectedViewController;
+@property (nonatomic, strong) NSArray *viewControllers;
+@property (nonatomic, strong) UIViewController *selectedViewController;
-@property (nonatomic, retain, readonly) UINavigationController *moreNavigationController;
+@property (nonatomic, strong, readonly) UINavigationController *moreNavigationController;
@property (nonatomic, copy) NSArray *customizableViewControllers;
#pragma mark Designated Initializer
Oops, something went wrong.

0 comments on commit 778b3f4

Please sign in to comment.