From da370c0f2b276c10f473f2879501e24537b4ebe9 Mon Sep 17 00:00:00 2001 From: Kevin Wojniak Date: Sun, 27 Sep 2015 12:24:47 -0700 Subject: [PATCH] Avoid converting URLs to paths to check for existence --- TestApplication/SUTestApplicationDelegate.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TestApplication/SUTestApplicationDelegate.m b/TestApplication/SUTestApplicationDelegate.m index 09e98c71..d62353c6 100644 --- a/TestApplication/SUTestApplicationDelegate.m +++ b/TestApplication/SUTestApplicationDelegate.m @@ -53,7 +53,7 @@ static NSString * const UPDATED_VERSION = @"2.0"; // Create a directory that'll be used for our web server listing NSURL *serverDirectoryURL = [cacheDirectoryURL URLByAppendingPathComponent:bundleIdentifier]; - if ([fileManager fileExistsAtPath:serverDirectoryURL.path]) { + if ([serverDirectoryURL checkResourceIsReachableAndReturnError:nil]) { NSError *removeServerDirectoryError = nil; if (![fileManager removeItemAtURL:serverDirectoryURL error:&removeServerDirectoryError]) { @@ -81,7 +81,7 @@ static NSString * const UPDATED_VERSION = @"2.0"; // Update bundle's version keys to latest version NSURL *infoURL = [[destinationBundleURL URLByAppendingPathComponent:@"Contents"] URLByAppendingPathComponent:@"Info.plist"]; - BOOL infoFileExists = [fileManager fileExistsAtPath:infoURL.path]; + BOOL infoFileExists = [infoURL checkResourceIsReachableAndReturnError:nil]; assert(infoFileExists); NSMutableDictionary *infoDictionary = [[NSMutableDictionary alloc] initWithContentsOfURL:infoURL];