Skip to content

Commit

Permalink
Make Testable use ARC to show that KIF works with ARC-enabled apps; f…
Browse files Browse the repository at this point in the history
…ix the one ARC incompatibility in KIF.
  • Loading branch information
Jim Puls committed Nov 15, 2011
1 parent 1f5832d commit 6238745
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Classes/KIFTestStep.h
Expand Up @@ -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; \
Expand Down
Expand Up @@ -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;
Expand All @@ -413,6 +414,7 @@
"$(inherited)",
RUN_KIF_TESTS,
);
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/Frameworks/KIF/**",
Expand All @@ -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/**",
Expand Down
Expand Up @@ -13,6 +13,6 @@
NSArray *titles;
}

@property (nonatomic, retain) NSArray *titles;
@property (nonatomic, strong) NSArray *titles;

@end
Expand Up @@ -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];
Expand Down
Expand Up @@ -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
Expand Up @@ -37,11 +37,5 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
return YES;
}

- (void)dealloc
{
[_window release];
[_navigationController release];
[super dealloc];
}

@end
8 changes: 4 additions & 4 deletions Documentation/Examples/Testable/Testable/main.m
Expand Up @@ -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.