Browse files

Conversion to ARC

  • Loading branch information...
1 parent efd5541 commit 68fc6d4913e1849528e5eef2e1263a519ab53c03 @reednj committed Jul 28, 2012
View
4 Demo/Classes/TDSemiModalAppDelegate.h
@@ -15,8 +15,8 @@
TDSemiModalDemoViewController *viewController;
}
-@property (nonatomic, retain) IBOutlet UIWindow *window;
-@property (nonatomic, retain) IBOutlet TDSemiModalDemoViewController *viewController;
+@property (nonatomic, strong) IBOutlet UIWindow *window;
+@property (nonatomic, strong) IBOutlet TDSemiModalDemoViewController *viewController;
@end
View
5 Demo/Classes/TDSemiModalAppDelegate.m
@@ -78,11 +78,6 @@ Free up as much memory as possible by purging cached data objects that can be re
}
-- (void)dealloc {
- [viewController release];
- [window release];
- [super dealloc];
-}
@end
View
3 Demo/Classes/TDSemiModalDemoViewController.m
@@ -31,9 +31,6 @@ - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interface
- (void)viewDidUnload {
}
--(void)dealloc {
- [super dealloc];
-}
#pragma mark -
#pragma mark User Actions
View
2 Demo/TDSemiModal.xcodeproj/project.pbxproj
@@ -224,6 +224,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ENABLE_OBJC_ARC = YES;
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
@@ -238,6 +239,7 @@
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 = TDSemiModal_Prefix.pch;
View
8 Demo/main.m
@@ -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;
+ }
}
View
4 Source/TDDatePickerController.h
@@ -13,8 +13,8 @@
id delegate;
}
-@property (nonatomic, retain) IBOutlet id delegate;
-@property (nonatomic, retain) IBOutlet UIDatePicker* datePicker;
+@property (nonatomic, strong) IBOutlet id delegate;
+@property (nonatomic, strong) IBOutlet UIDatePicker* datePicker;
-(IBAction)saveDateEdit:(id)sender;
-(IBAction)clearDateEdit:(id)sender;
View
6 Source/TDDatePickerController.m
@@ -67,12 +67,6 @@ - (void)viewDidUnload {
}
-- (void)dealloc {
- self.datePicker = nil;
- self.delegate = nil;
-
- [super dealloc];
-}
@end
View
2 Source/TDSemiModalViewController.h
@@ -10,6 +10,6 @@
@interface TDSemiModalViewController : UIViewController
-@property (nonatomic, retain) UIView *coverView;
+@property (nonatomic, strong) UIView *coverView;
@end
View
4 Source/TDSemiModalViewController.m
@@ -34,9 +34,5 @@ - (void)viewDidUnload {
self.coverView = nil;
}
-- (void)dealloc {
- self.coverView = nil;
- [super dealloc];
-}
@end
View
4 Source/UIViewController+TDSemiModalExtension.m
@@ -77,7 +77,7 @@ -(void) dismissSemiModalViewController:(TDSemiModalViewController*)vc {
offScreenCenter = CGPointMake(offSize.width / 2.0, offSize.height * 1.5);
}
- [UIView beginAnimations:nil context:modalView];
+ [UIView beginAnimations:nil context:(__bridge void *)(modalView)];
[UIView setAnimationDuration:animationDelay];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(dismissSemiModalViewControllerEnded:finished:context:)];
@@ -90,7 +90,7 @@ -(void) dismissSemiModalViewController:(TDSemiModalViewController*)vc {
}
- (void) dismissSemiModalViewControllerEnded:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context {
- UIView* modalView = (UIView*)context;
+ UIView* modalView = (__bridge UIView*)context;
[modalView removeFromSuperview];
}

0 comments on commit 68fc6d4

Please sign in to comment.