Permalink
Browse files

Make Testable use ARC to show that KIF works with ARC-enabled apps; f…

…ix the one ARC incompatibility in KIF.
  • Loading branch information...
1 parent 1f5832d commit 6238745297df9bb56711f1afe6964a5057db658a Jim Puls committed Nov 15, 2011
View
@@ -21,7 +21,7 @@
#define KIFTestCondition(condition, error, ...) ({ \
if (!(condition)) { \
if (error) { \
- *error = [[[NSError alloc] initWithDomain:@"KIFTest" code:KIFTestStepResultFailure userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:__VA_ARGS__], NSLocalizedDescriptionKey, nil]] autorelease]; \
+ *error = [NSError errorWithDomain:@"KIFTest" code:KIFTestStepResultFailure userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:__VA_ARGS__], NSLocalizedDescriptionKey, nil]]; \
} \
[KIFTestStep stepFailed]; \
return KIFTestStepResultFailure; \
@@ -405,6 +405,7 @@
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;
@@ -413,6 +414,7 @@
"$(inherited)",
RUN_KIF_TESTS,
);
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/Frameworks/KIF/**",
@@ -435,13 +437,15 @@
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 = "Testable/Testable-Prefix.pch";
GCC_PREPROCESSOR_DEFINITIONS = (
"$(inherited)",
RUN_KIF_TESTS,
);
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/Frameworks/KIF/**",
@@ -13,6 +13,6 @@
NSArray *titles;
}
-@property (nonatomic, retain) NSArray *titles;
+@property (nonatomic, strong) NSArray *titles;
@end
@@ -39,7 +39,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.textLabel.text = [self.titles objectAtIndex:indexPath.row];
@@ -13,7 +13,7 @@
}
-@property (nonatomic, retain) IBOutlet UIWindow *window;
-@property (nonatomic, retain) IBOutlet UINavigationController *navigationController;
+@property (nonatomic, strong) IBOutlet UIWindow *window;
+@property (nonatomic, strong) IBOutlet UINavigationController *navigationController;
@end
@@ -37,11 +37,5 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
return YES;
}
-- (void)dealloc
-{
- [_window release];
- [_navigationController release];
- [super dealloc];
-}
@end
@@ -11,8 +11,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;
+ }
}

0 comments on commit 6238745

Please sign in to comment.