Skip to content

Commit

Permalink
Remove unused helper methods
Browse files Browse the repository at this point in the history
  • Loading branch information
jmoody committed Oct 24, 2014
1 parent 25fab10 commit 44b7413
Showing 1 changed file with 0 additions and 32 deletions.
32 changes: 0 additions & 32 deletions calabash/Classes/Utils/LPUIAUserPrefsChannel.m
Original file line number Diff line number Diff line change
Expand Up @@ -261,38 +261,6 @@ - (NSString *)simulatorPreferencesPath {
return path;
}

- (NSString *) stringForXcode61PreferencesPlistWithUserLibraryPath:(NSString *) aUserLibraryPath
plistName:(NSString *) aPlistName
tokenKey:(NSString *) aTokenKey
tokenValue:(NSString *) aTokenValue {
NSString *relativePlistPath = [NSString stringWithFormat:@"Preferences/%@", aPlistName];
NSString *unsanitizedPlistPath = [aUserLibraryPath stringByAppendingPathComponent:relativePlistPath];
NSString *path = [unsanitizedPlistPath stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];

if (![[NSFileManager defaultManager] fileExistsAtPath:path]) {
return nil;
}

NSDictionary *dictionary = [NSDictionary dictionaryWithContentsOfFile:path];
if ([[dictionary objectForKey:aTokenKey] isEqualToString:aTokenValue]) {
return path;
} else {
return nil;
}
}

- (NSString *) stringForXcode60PreferencesPlistWithUserLibraryPath:(NSString *) aUserLibraryPath
plistName:(NSString *) aPlistName {
// Xcode 6.0 and 6.0.1 have a buggy NSUserDefaults implementation. Values
// may or may not be written when [NSUserDefaults synchronize] is called, so
// it is not worth checking for the key/token pair.
NSRange range = [aUserLibraryPath rangeOfString:@"data"];
NSString *simulatorDataPath = [aUserLibraryPath substringToIndex:range.location + range.length];
NSString *relativePlistPath = [NSString stringWithFormat:@"Library/Preferences/%@", aPlistName];
NSString *unsanitizedPlistPath = [simulatorDataPath stringByAppendingPathComponent:relativePlistPath];
return [unsanitizedPlistPath stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
}

#endif // TARGET_IPHONE_SIMULATOR

@end

0 comments on commit 44b7413

Please sign in to comment.