Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Support both ARC and non-ARC environments automatically at compile time.

  • Loading branch information...
commit eb8640b1be9d1f5bbc258ab8e04345d390b9e816 1 parent 4ccb2d8
@granoff authored
Showing with 14 additions and 2 deletions.
  1. +9 −0 LockBox/LockBox/AppDelegate.m
  2. +5 −2 Lockbox.m
View
9 LockBox/LockBox/AppDelegate.m
@@ -25,6 +25,15 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
return YES;
}
+#if !__has_feature(objc_arc)
+-(void)dealloc
+{
+ [_viewController release];
+ [_window release];
+ [super dealloc];
+}
+#endif
+
- (void)applicationWillResignActive:(UIApplication *)application
{
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
View
7 Lockbox.m
@@ -93,11 +93,14 @@ +(NSString *)objectForKey:(NSString *)key
if (!data)
return nil;
- NSString *s = [[[NSString alloc]
+ NSString *s = [[NSString alloc]
initWithData: data
- encoding: NSUTF8StringEncoding] autorelease];
+ encoding: NSUTF8StringEncoding];
+#if !__has_feature(objc_arc)
+ [s autorelease];
[data autorelease];
+#endif
return s;
}
Please sign in to comment.
Something went wrong with that request. Please try again.