Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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...
commit 6238745297df9bb56711f1afe6964a5057db658a 1 parent 1f5832d
Jim Puls authored
View
2  Classes/KIFTestStep.h
@@ -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; \
View
4 Documentation/Examples/Testable/Testable.xcodeproj/project.pbxproj
@@ -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,6 +437,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 = "Testable/Testable-Prefix.pch";
@@ -442,6 +445,7 @@
"$(inherited)",
RUN_KIF_TESTS,
);
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/Frameworks/KIF/**",
View
2  Documentation/Examples/Testable/Testable/RootViewController.h
@@ -13,6 +13,6 @@
NSArray *titles;
}
-@property (nonatomic, retain) NSArray *titles;
+@property (nonatomic, strong) NSArray *titles;
@end
View
2  Documentation/Examples/Testable/Testable/RootViewController.m
@@ -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];
View
4 Documentation/Examples/Testable/Testable/TestableAppDelegate.h
@@ -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
View
6 Documentation/Examples/Testable/Testable/TestableAppDelegate.m
@@ -37,11 +37,5 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
return YES;
}
-- (void)dealloc
-{
- [_window release];
- [_navigationController release];
- [super dealloc];
-}
@end
View
8 Documentation/Examples/Testable/Testable/main.m
@@ -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;
+ }
}
Please sign in to comment.
Something went wrong with that request. Please try again.