Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Converted project to ARC (while trying to minimize the changes).

  • Loading branch information...
commit f6d938321a1d70893d5338bbf1e5095659d70b61 1 parent 8b2f1f8
Troy Gaul authored
View
4 Demo/Classes/AppDelegate.h
@@ -15,8 +15,8 @@
ViewController *viewController;
}
-@property (nonatomic, retain) IBOutlet UIWindow *window;
-@property (nonatomic, retain) IBOutlet ViewController *viewController;
+@property (nonatomic) IBOutlet UIWindow *window;
+@property (nonatomic) IBOutlet ViewController *viewController;
@end
View
5 Demo/Classes/AppDelegate.m
@@ -25,11 +25,6 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
return YES;
}
-- (void)dealloc {
- [viewController release];
- [window release];
- [super dealloc];
-}
@end
View
4 Demo/SVProgressHUD.xcodeproj/project.pbxproj
@@ -220,11 +220,13 @@
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+ CLANG_ENABLE_OBJC_ARC = YES;
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = SVProgressHUD_Prefix.pch;
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
INFOPLIST_FILE = "SVProgressHUD-Info.plist";
OTHER_CFLAGS = "-DSVPROGRESSHUD_DISABLE_NETWORK_INDICATOR";
PRODUCT_NAME = SVProgressHUD;
@@ -238,9 +240,11 @@
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+ CLANG_ENABLE_OBJC_ARC = YES;
COPY_PHASE_STRIP = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = SVProgressHUD_Prefix.pch;
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
INFOPLIST_FILE = "SVProgressHUD-Info.plist";
PRODUCT_NAME = SVProgressHUD;
SDKROOT = iphoneos;
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
21 SVProgressHUD/SVProgressHUD.m
@@ -14,7 +14,7 @@ @interface SVProgressHUD ()
@property (nonatomic, readwrite) SVProgressHUDMaskType maskType;
@property (nonatomic, readwrite) BOOL showNetworkIndicator;
-@property (nonatomic, retain) NSTimer *fadeOutTimer;
+@property (nonatomic) NSTimer *fadeOutTimer;
@property (nonatomic, readonly) UIWindow *overlayWindow;
@property (nonatomic, readonly) UIView *hudView;
@@ -48,12 +48,7 @@ - (void)dealloc {
self.fadeOutTimer = nil;
[[NSNotificationCenter defaultCenter] removeObserver:self];
- [hudView release];
- [stringLabel release];
- [imageView release];
- [spinnerView release];
- [super dealloc];
}
@@ -234,10 +229,10 @@ - (void)setStatus:(NSString *)string {
- (void)setFadeOutTimer:(NSTimer *)newTimer {
if(fadeOutTimer)
- [fadeOutTimer invalidate], [fadeOutTimer release], fadeOutTimer = nil;
+ [fadeOutTimer invalidate], fadeOutTimer = nil;
if(newTimer)
- fadeOutTimer = [newTimer retain];
+ fadeOutTimer = newTimer;
}
@@ -449,8 +444,8 @@ - (void)dismiss {
completion:^(BOOL finished){
if(sharedView.alpha == 0) {
[[NSNotificationCenter defaultCenter] removeObserver:sharedView];
- [overlayWindow release], overlayWindow = nil;
- [sharedView release], sharedView = nil;
+ overlayWindow = nil;
+ sharedView = nil;
// find the frontmost window that is an actual UIWindow and make it keyVisible
[[UIApplication sharedApplication].windows enumerateObjectsWithOptions:NSEnumerationReverse usingBlock:^(UIWindow *window, NSUInteger idx, BOOL *stop) {
@@ -536,8 +531,6 @@ - (UIActivityIndicatorView *)spinnerView {
- (CGFloat)visibleKeyboardHeight {
- NSAutoreleasePool *autoreleasePool = [[NSAutoreleasePool alloc] init];
-
UIWindow *keyboardWindow = nil;
for (UIWindow *testWindow in [[UIApplication sharedApplication] windows]) {
if(![[testWindow class] isEqual:[UIWindow class]]) {
@@ -548,7 +541,7 @@ - (CGFloat)visibleKeyboardHeight {
// Locate UIKeyboard.
UIView *foundKeyboard = nil;
- for (UIView *possibleKeyboard in [keyboardWindow subviews]) {
+ for (__strong UIView *possibleKeyboard in [keyboardWindow subviews]) {
// iOS 4 sticks the UIKeyboard inside a UIPeripheralHostView.
if ([[possibleKeyboard description] hasPrefix:@"<UIPeripheralHostView"]) {
@@ -560,8 +553,6 @@ - (CGFloat)visibleKeyboardHeight {
break;
}
}
-
- [autoreleasePool release];
if(foundKeyboard && foundKeyboard.bounds.size.height > 100)
return foundKeyboard.bounds.size.height;
Please sign in to comment.
Something went wrong with that request. Please try again.