diff --git a/Sparkle/SUAppcast.m b/Sparkle/SUAppcast.m index 05cba1cd..d97c9e8c 100644 --- a/Sparkle/SUAppcast.m +++ b/Sparkle/SUAppcast.m @@ -30,7 +30,10 @@ if (!attrName) { continue; } - dictionary[attrName] = [attribute stringValue]; + NSString *attributeStringValue = [attribute stringValue]; + if (attributeStringValue != nil) { + [dictionary setObject:attributeStringValue forKey:attrName]; + } } return dictionary; } @@ -107,7 +110,7 @@ dictionaryWithObject: SULocalizedString(@"An error occurred while parsing the update feed.", nil) forKey: NSLocalizedDescriptionKey]; if (error) { - userInfo[NSUnderlyingErrorKey] = error; + [userInfo setObject:error forKey:NSUnderlyingErrorKey]; } [self reportError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUAppcastParseError @@ -149,10 +152,10 @@ while (nil != node) { NSString *name = [node name]; if (name) { - NSMutableArray *nodes = nodesDict[name]; + NSMutableArray *nodes = [nodesDict objectForKey:name]; if (nodes == nil) { nodes = [NSMutableArray array]; - nodesDict[name] = nodes; + [nodesDict setObject:nodes forKey:name]; } [nodes addObject:node]; } @@ -161,11 +164,11 @@ } for (NSString *name in nodesDict) { - node = [self bestNodeInNodes:nodesDict[name]]; + node = [self bestNodeInNodes:[nodesDict objectForKey:name]]; if ([name isEqualToString:SURSSElementEnclosure]) { // enclosure is flattened as a separate dictionary for some reason NSDictionary *encDict = [(NSXMLElement *)node attributesAsDictionary]; - dict[name] = encDict; + [dict setObject:encDict forKey:name]; } else if ([name isEqualToString:SURSSElementPubDate]) { // We don't want to parse and create a NSDate instance - @@ -173,7 +176,7 @@ // than it being accessible from SUAppcastItem NSString *dateString = node.stringValue; if (dateString) { - dict[name] = dateString; + [dict setObject:dateString forKey:name]; } } else if ([name isEqualToString:SUAppcastElementDeltas]) { @@ -184,7 +187,7 @@ [deltas addObject:[(NSXMLElement *)child attributesAsDictionary]]; } } - dict[name] = deltas; + [dict setObject:deltas forKey:name]; } else if ([name isEqualToString:SUAppcastElementTags]) { NSMutableArray *tags = [NSMutableArray array]; @@ -195,13 +198,13 @@ [tags addObject:childName]; } } - dict[name] = tags; + [dict setObject:tags forKey:name]; } else if (name != nil) { // add all other values as strings NSString *theValue = [[node stringValue] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; if (theValue != nil) { - dict[name] = theValue; + [dict setObject:theValue forKey:name]; } } } @@ -261,7 +264,7 @@ { // We use this method to pick out the localized version of a node when one's available. if ([nodes count] == 1) - return nodes[0]; + return [nodes objectAtIndex:0]; else if ([nodes count] == 0) return nil; @@ -272,12 +275,12 @@ lang = [[node attributeForName:@"xml:lang"] stringValue]; [languages addObject:(lang ? lang : @"")]; } - lang = [NSBundle preferredLocalizationsFromArray:languages][0]; + lang = [[NSBundle preferredLocalizationsFromArray:languages] objectAtIndex:0]; i = [languages indexOfObject:([languages containsObject:lang] ? lang : @"")]; if (i == NSNotFound) { i = 0; } - return nodes[i]; + return [nodes objectAtIndex:i]; } - (SUAppcast *)copyWithoutDeltaUpdates { diff --git a/Sparkle/SUAppcastItem.m b/Sparkle/SUAppcastItem.m index 972758ba..4cbc4e44 100644 --- a/Sparkle/SUAppcastItem.m +++ b/Sparkle/SUAppcastItem.m @@ -47,12 +47,13 @@ - (BOOL)isDeltaUpdate { - return self.propertiesDictionary[SURSSElementEnclosure][SUAppcastAttributeDeltaFrom] != nil; + NSDictionary *rssElementEnclosure = [self.propertiesDictionary objectForKey:SURSSElementEnclosure]; + return [rssElementEnclosure objectForKey:SUAppcastAttributeDeltaFrom] != nil; } - (BOOL)isCriticalUpdate { - return [self.propertiesDictionary[SUAppcastElementTags] containsObject:SUAppcastElementCriticalUpdate]; + return [[self.propertiesDictionary objectForKey:SUAppcastElementTags] containsObject:SUAppcastElementCriticalUpdate]; } - (BOOL)isInformationOnlyUpdate @@ -69,7 +70,7 @@ { self = [super init]; if (self) { - id enclosure = dict[SURSSElementEnclosure]; + NSDictionary *enclosure = [dict objectForKey:SURSSElementEnclosure]; // Try to find a version string. // Finding the new version number from the RSS feed is a little bit hacky. There are two ways: @@ -79,17 +80,17 @@ // underscore and the last period as the version number. So name your packages like this: APPNAME_VERSION.extension. // The big caveat with this is that you can't have underscores in your version strings, as that'll confuse Sparkle. // Feel free to change the separator string to a hyphen or something more suited to your needs if you like. - NSString *newVersion = enclosure[SUAppcastAttributeVersion]; + NSString *newVersion = [enclosure objectForKey:SUAppcastAttributeVersion]; if (newVersion == nil) { - newVersion = dict[SUAppcastAttributeVersion]; // Get version from the item, in case it's a download-less item (i.e. paid upgrade). + newVersion = [dict objectForKey:SUAppcastAttributeVersion]; // Get version from the item, in case it's a download-less item (i.e. paid upgrade). } if (newVersion == nil) // no sparkle:version attribute anywhere? { - SULog(@"warning: <%@> for URL '%@' is missing %@ attribute. Version comparison may be unreliable. Please always specify %@", SURSSElementEnclosure, enclosure[SURSSAttributeURL], SUAppcastAttributeVersion, SUAppcastAttributeVersion); + SULog(@"warning: <%@> for URL '%@' is missing %@ attribute. Version comparison may be unreliable. Please always specify %@", SURSSElementEnclosure, [enclosure objectForKey:SURSSAttributeURL], SUAppcastAttributeVersion, SUAppcastAttributeVersion); // Separate the url by underscores and take the last component, as that'll be closest to the end, // then we remove the extension. Hopefully, this will be the version. - NSArray *fileComponents = [enclosure[SURSSAttributeURL] componentsSeparatedByString:@"_"]; + NSArray *fileComponents = [[enclosure objectForKey:SURSSAttributeURL] componentsSeparatedByString:@"_"]; if ([fileComponents count] > 1) { newVersion = [[fileComponents lastObject] stringByDeletingPathExtension]; } @@ -103,11 +104,11 @@ } propertiesDictionary = [[NSMutableDictionary alloc] initWithDictionary:dict]; - self.title = dict[SURSSElementTitle]; - self.dateString = dict[SURSSElementPubDate]; - self.itemDescription = dict[SURSSElementDescription]; + self.title = [dict objectForKey:SURSSElementTitle]; + self.dateString = [dict objectForKey:SURSSElementPubDate]; + self.itemDescription = [dict objectForKey:SURSSElementDescription]; - NSString *theInfoURL = dict[SURSSElementLink]; + NSString *theInfoURL = [dict objectForKey:SURSSElementLink]; if (theInfoURL) { if (![theInfoURL isKindOfClass:[NSString class]]) { SULog(@"%@ -%@ Info URL is not of valid type.", NSStringFromClass([self class]), NSStringFromSelector(_cmd)); @@ -125,7 +126,7 @@ return nil; } - NSString *enclosureURLString = enclosure[SURSSAttributeURL]; + NSString *enclosureURLString = [enclosure objectForKey:SURSSAttributeURL]; if (!enclosureURLString && !theInfoURL) { if (error) { *error = @"Feed item's enclosure lacks URL"; @@ -139,16 +140,16 @@ self.fileURL = [NSURL URLWithString:fileURLString]; } if (enclosure) { - self.DSASignature = enclosure[SUAppcastAttributeDSASignature]; + self.DSASignature = [enclosure objectForKey:SUAppcastAttributeDSASignature]; } self.versionString = newVersion; - self.minimumSystemVersion = dict[SUAppcastElementMinimumSystemVersion]; - self.maximumSystemVersion = dict[SUAppcastElementMaximumSystemVersion]; + self.minimumSystemVersion = [dict objectForKey:SUAppcastElementMinimumSystemVersion]; + self.maximumSystemVersion = [dict objectForKey:SUAppcastElementMaximumSystemVersion]; - NSString *shortVersionString = enclosure[SUAppcastAttributeShortVersionString]; + NSString *shortVersionString = [enclosure objectForKey:SUAppcastAttributeShortVersionString]; if (nil == shortVersionString) { - shortVersionString = dict[SUAppcastAttributeShortVersionString]; // fall back on the + shortVersionString = [dict objectForKey:SUAppcastAttributeShortVersionString]; // fall back on the } if (shortVersionString) { @@ -158,7 +159,7 @@ } // Find the appropriate release notes URL. - NSString *releaseNotesString = dict[SUAppcastElementReleaseNotesLink]; + NSString *releaseNotesString = [dict objectForKey:SUAppcastElementReleaseNotesLink]; if (releaseNotesString) { NSURL *url = [NSURL URLWithString:releaseNotesString]; if ([url isFileURL]) { @@ -172,19 +173,19 @@ self.releaseNotesURL = nil; } - NSArray *deltaDictionaries = dict[SUAppcastElementDeltas]; + NSArray *deltaDictionaries = [dict objectForKey:SUAppcastElementDeltas]; if (deltaDictionaries) { NSMutableDictionary *deltas = [NSMutableDictionary dictionary]; for (NSDictionary *deltaDictionary in deltaDictionaries) { - NSString *deltaFrom = deltaDictionary[SUAppcastAttributeDeltaFrom]; + NSString *deltaFrom = [deltaDictionary objectForKey:SUAppcastAttributeDeltaFrom]; if (!deltaFrom) continue; NSMutableDictionary *fakeAppCastDict = [dict mutableCopy]; [fakeAppCastDict removeObjectForKey:SUAppcastElementDeltas]; - fakeAppCastDict[SURSSElementEnclosure] = deltaDictionary; + [fakeAppCastDict setObject:deltaDictionary forKey:SURSSElementEnclosure]; SUAppcastItem *deltaItem = [[SUAppcastItem alloc] initWithDictionary:fakeAppCastDict]; - deltas[deltaFrom] = deltaItem; + [deltas setObject:deltaItem forKey:deltaFrom]; } self.deltaUpdates = deltas; } diff --git a/Sparkle/SUBasicUpdateDriver.m b/Sparkle/SUBasicUpdateDriver.m index fefc6a71..2f1230a1 100644 --- a/Sparkle/SUBasicUpdateDriver.m +++ b/Sparkle/SUBasicUpdateDriver.m @@ -94,7 +94,7 @@ } if (item && deltaItem) { - SUAppcastItem *deltaUpdateItem = [item deltaUpdates][hostVersion]; + SUAppcastItem *deltaUpdateItem = [[item deltaUpdates] objectForKey:hostVersion]; if (deltaUpdateItem && [[self class] hostSupportsItem:deltaUpdateItem]) { *deltaItem = deltaUpdateItem; } @@ -335,7 +335,7 @@ - (void)download:(NSURLDownload *)__unused download didFailWithError:(NSError *)error { - NSURL *failingUrl = error.userInfo[NSURLErrorFailingURLErrorKey]; + NSURL *failingUrl = [error.userInfo objectForKey:NSURLErrorFailingURLErrorKey]; if (!failingUrl) { failingUrl = [self.updateItem fileURL]; } @@ -351,7 +351,7 @@ NSUnderlyingErrorKey: error, }]; if (failingUrl) { - userInfo[NSURLErrorFailingURLErrorKey] = failingUrl; + [userInfo setObject:failingUrl forKey:NSURLErrorFailingURLErrorKey]; } [self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUDownloadError userInfo:userInfo]]; @@ -581,8 +581,8 @@ NSError *errorToDisplay = error; int finiteRecursion=5; do { - SULog(@"Error: %@ %@ (URL %@)", errorToDisplay.localizedDescription, errorToDisplay.localizedFailureReason, errorToDisplay.userInfo[NSURLErrorFailingURLErrorKey]); - errorToDisplay = errorToDisplay.userInfo[NSUnderlyingErrorKey]; + SULog(@"Error: %@ %@ (URL %@)", errorToDisplay.localizedDescription, errorToDisplay.localizedFailureReason, [errorToDisplay.userInfo objectForKey:NSURLErrorFailingURLErrorKey]); + errorToDisplay = [errorToDisplay.userInfo objectForKey:NSUnderlyingErrorKey]; } while(--finiteRecursion && errorToDisplay); } if (self.download) { diff --git a/Sparkle/SUCodeSigningVerifier.m b/Sparkle/SUCodeSigningVerifier.m index 8690641b..7684b4d6 100644 --- a/Sparkle/SUCodeSigningVerifier.m +++ b/Sparkle/SUCodeSigningVerifier.m @@ -141,11 +141,11 @@ static id valueOrNSNull(id value) { NSDictionary *signingDict = CFBridgingRelease(signingInfo); NSMutableDictionary *relevantInfo = [NSMutableDictionary dictionary]; for (NSString *key in @[@"format", @"identifier", @"requirements", @"teamid", @"signing-time"]) { - relevantInfo[key] = valueOrNSNull(signingDict[key]); + [relevantInfo setObject:valueOrNSNull([signingDict objectForKey:key]) forKey:key]; } - NSDictionary *infoPlist = signingDict[@"info-plist"]; - relevantInfo[@"version"] = valueOrNSNull(infoPlist[@"CFBundleShortVersionString"]); - relevantInfo[@"build"] = valueOrNSNull(infoPlist[(__bridge NSString *)kCFBundleVersionKey]); + NSDictionary *infoPlist = [signingDict objectForKey:@"info-plist"]; + [relevantInfo setObject:valueOrNSNull([infoPlist objectForKey:@"CFBundleShortVersionString"]) forKey:@"version"]; + [relevantInfo setObject:valueOrNSNull([infoPlist objectForKey:(__bridge NSString *)kCFBundleVersionKey]) forKey:@"build"]; SULog(@"%@: %@", label, relevantInfo); } } diff --git a/Sparkle/SUFileManager.m b/Sparkle/SUFileManager.m index d0fc3b00..68bceae0 100644 --- a/Sparkle/SUFileManager.m +++ b/Sparkle/SUFileManager.m @@ -903,7 +903,10 @@ static BOOL SUMakeRefFromURL(NSURL *url, FSRef *ref, NSError **error) { if (canUseNewTrashAPI) { NSError *trashError = nil; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wpartial-availability" success = [_fileManager trashItemAtURL:tempItemURL resultingItemURL:NULL error:&trashError]; +#pragma clang diagnostic pop if (!success && error != NULL) { *error = trashError; } diff --git a/Sparkle/SUOperatingSystem.m b/Sparkle/SUOperatingSystem.m index d9f1e90a..2d528027 100644 --- a/Sparkle/SUOperatingSystem.m +++ b/Sparkle/SUOperatingSystem.m @@ -28,7 +28,11 @@ return version; } #endif + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wpartial-availability" return [[NSProcessInfo processInfo] operatingSystemVersion]; +#pragma clang diagnostic pop } + (BOOL)isOperatingSystemAtLeastVersion:(NSOperatingSystemVersion)version diff --git a/Sparkle/SUPipedUnarchiver.m b/Sparkle/SUPipedUnarchiver.m index dc0b5192..dcaad43e 100644 --- a/Sparkle/SUPipedUnarchiver.m +++ b/Sparkle/SUPipedUnarchiver.m @@ -30,7 +30,7 @@ NSString *lastPathComponent = [path lastPathComponent]; for (NSString *currentType in typeSelectorDictionary) { - NSString *value = typeSelectorDictionary[currentType]; + NSString *value = [typeSelectorDictionary objectForKey:currentType]; assert(value); if ([currentType length] > [lastPathComponent length]) continue; diff --git a/Sparkle/SUStandardVersionComparator.m b/Sparkle/SUStandardVersionComparator.m index b7c876a5..415c3074 100644 --- a/Sparkle/SUStandardVersionComparator.m +++ b/Sparkle/SUStandardVersionComparator.m @@ -91,8 +91,8 @@ typedef NS_ENUM(NSInteger, SUCharacterType) { n = MIN([partsA count], [partsB count]); for (i = 0; i < n; ++i) { - partA = partsA[i]; - partB = partsB[i]; + partA = [partsA objectAtIndex:i]; + partB = [partsB objectAtIndex:i]; typeA = [self typeOfCharacter:partA]; typeB = [self typeOfCharacter:partB]; @@ -142,11 +142,11 @@ typedef NS_ENUM(NSInteger, SUCharacterType) { NSComparisonResult shorterResult, largerResult; if ([partsA count] > [partsB count]) { - missingPart = partsA[n]; + missingPart = [partsA objectAtIndex:n]; shorterResult = NSOrderedAscending; largerResult = NSOrderedDescending; } else { - missingPart = partsB[n]; + missingPart = [partsB objectAtIndex:n]; shorterResult = NSOrderedDescending; largerResult = NSOrderedAscending; } diff --git a/Sparkle/SUUIBasedUpdateDriver.m b/Sparkle/SUUIBasedUpdateDriver.m index a3b25d0b..3e51f2d3 100644 --- a/Sparkle/SUUIBasedUpdateDriver.m +++ b/Sparkle/SUUIBasedUpdateDriver.m @@ -164,8 +164,11 @@ SULocalizedString(@"GB", @"the unit for gigabytes")]; } +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wpartial-availability" return [NSByteCountFormatter stringFromByteCount:value countStyle:NSByteCountFormatterCountStyleFile]; +#pragma clang diagnostic pop } - (void)download:(NSURLDownload *)__unused download didReceiveDataOfLength:(NSUInteger)length diff --git a/Sparkle/SUUpdater.m b/Sparkle/SUUpdater.m index ea6bf5b8..a5498ff1 100644 --- a/Sparkle/SUUpdater.m +++ b/Sparkle/SUUpdater.m @@ -68,7 +68,7 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults + (SUUpdater *)updaterForBundle:(NSBundle *)bundle { if (bundle == nil) bundle = [NSBundle mainBundle]; - id updater = sharedUpdaters[[NSValue valueWithNonretainedObject:bundle]]; + id updater = [sharedUpdaters objectForKey:[NSValue valueWithNonretainedObject:bundle]]; if (updater == nil) { updater = [[[self class] alloc] initForBundle:bundle]; } @@ -93,7 +93,7 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults [self registerAsObserver]; } - id updater = sharedUpdaters[[NSValue valueWithNonretainedObject:bundle]]; + id updater = [sharedUpdaters objectForKey:[NSValue valueWithNonretainedObject:bundle]]; if (updater) { self = updater; @@ -103,7 +103,7 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults if (sharedUpdaters == nil) { sharedUpdaters = [[NSMutableDictionary alloc] init]; } - sharedUpdaters[[NSValue valueWithNonretainedObject:bundle]] = self; + [sharedUpdaters setObject:self forKey:[NSValue valueWithNonretainedObject:bundle]]; host = [[SUHost alloc] initWithBundle:bundle]; // This runs the permission prompt if needed, but never before the app has finished launching because the runloop won't run before that @@ -251,7 +251,10 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults - (void)putFeedURLIntoDictionary:(NSMutableDictionary *)theDict // You release this. { - theDict[@"feedURL"] = [self feedURL]; + NSURL *feedURL = [self feedURL]; + if (feedURL != nil) { + [theDict setObject:feedURL forKey:@"feedURL"]; + } } - (void)checkForUpdatesInBgReachabilityCheckWithDriver:(SUUpdateDriver *)inDriver /* RUNS ON ITS OWN THREAD */ @@ -273,7 +276,7 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults [self putFeedURLIntoDictionary:theDict]; // Get feed URL on main thread, it's not safe to call elsewhere. }); - const char *hostname = [[(NSURL *)theDict[@"feedURL"] host] cStringUsingEncoding:NSUTF8StringEncoding]; + const char *hostname = [[(NSURL *)[theDict objectForKey:@"feedURL"] host] cStringUsingEncoding:NSUTF8StringEncoding]; SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithName(NULL, hostname); Boolean reachabilityResult = NO; // If the feed's using a file:// URL, we won't be able to use reachability. @@ -537,7 +540,7 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults // Build up the parameterized URL. NSMutableArray *parameterStrings = [NSMutableArray array]; for (NSDictionary *currentProfileInfo in parameters) { - [parameterStrings addObject:[NSString stringWithFormat:@"%@=%@", [[currentProfileInfo[@"key"] description] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding], [[currentProfileInfo[@"value"] description] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]]; + [parameterStrings addObject:[NSString stringWithFormat:@"%@=%@", [[[currentProfileInfo objectForKey:@"key"] description] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding], [[[currentProfileInfo objectForKey:@"value"] description] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]]; } NSString *separatorCharacter = @"?"; diff --git a/TestApplication/SUTestApplicationDelegate.m b/TestApplication/SUTestApplicationDelegate.m index c42f5cfb..d360c607 100644 --- a/TestApplication/SUTestApplicationDelegate.m +++ b/TestApplication/SUTestApplicationDelegate.m @@ -73,7 +73,10 @@ static NSString * const UPDATED_VERSION = @"2.0"; assert(bundleURL != nil); // Copy main bundle into server directory - NSURL *destinationBundleURL = [serverDirectoryURL URLByAppendingPathComponent:bundleURL.lastPathComponent]; + NSString *bundleURLLastComponent = bundleURL.lastPathComponent; + assert(bundleURLLastComponent != nil); + + NSURL *destinationBundleURL = [serverDirectoryURL URLByAppendingPathComponent:bundleURLLastComponent]; NSError *copyBundleError = nil; if (![fileManager copyItemAtURL:bundleURL toURL:destinationBundleURL error:©BundleError]) { NSLog(@"Failed to copy main bundle into server directory with error %@", copyBundleError); @@ -87,8 +90,8 @@ static NSString * const UPDATED_VERSION = @"2.0"; assert(infoFileExists); NSMutableDictionary *infoDictionary = [[NSMutableDictionary alloc] initWithContentsOfURL:infoURL]; - infoDictionary[(__bridge NSString *)kCFBundleVersionKey] = UPDATED_VERSION; - infoDictionary[@"CFBundleShortVersionString"] = UPDATED_VERSION; + [infoDictionary setObject:UPDATED_VERSION forKey:(__bridge NSString *)kCFBundleVersionKey]; + [infoDictionary setObject:UPDATED_VERSION forKey:@"CFBundleShortVersionString"]; BOOL wroteInfoFile = [infoDictionary writeToURL:infoURL atomically:NO]; assert(wroteInfoFile); @@ -139,7 +142,9 @@ static NSString * const UPDATED_VERSION = @"2.0"; // Obtain the file attributes to get the file size of our update later NSError *fileAttributesError = nil; - NSDictionary *archiveFileAttributes = [[NSFileManager defaultManager] attributesOfItemAtPath:archiveURL.path error:&fileAttributesError]; + NSString *archivePath = archiveURL.path; + assert(archivePath != nil); + NSDictionary *archiveFileAttributes = [[NSFileManager defaultManager] attributesOfItemAtPath:archivePath error:&fileAttributesError]; if (archiveFileAttributes == nil) { NSLog(@"Failed to retrieve file attributes from archive with error %@", fileAttributesError); assert(NO); diff --git a/TestApplication/SUTestWebServer.m b/TestApplication/SUTestWebServer.m index d8093272..2ca31e8e 100644 --- a/TestApplication/SUTestWebServer.m +++ b/TestApplication/SUTestWebServer.m @@ -93,12 +93,12 @@ if (numBytes > 0) { NSString *request = [[NSString alloc] initWithBytes:buffer length:(NSUInteger)numBytes encoding:NSUTF8StringEncoding]; NSArray *lines = [request componentsSeparatedByString:@"\r\n"]; - NSString *requestLine = lines.count >= 3 ? lines[0] : nil; + NSString *requestLine = lines.count >= 3 ? [lines objectAtIndex:0] : nil; NSArray *parts = requestLine ? [requestLine componentsSeparatedByString:@" "] : nil; // Only process GET requests for existing files - if ([parts[0] isEqualToString:@"GET"]) { + if ([[parts objectAtIndex:0] isEqualToString:@"GET"]) { // Use NSURL to strip out query parameters - NSString *path = [NSURL URLWithString:parts[1] relativeToURL:nil].path; + NSString *path = [NSURL URLWithString:[parts objectAtIndex:1] relativeToURL:nil].path; NSString *filePath = [self.workingDirectory stringByAppendingString:path]; BOOL isDir = NO; if (![[NSFileManager defaultManager] fileExistsAtPath:filePath isDirectory:&isDir] || isDir) { diff --git a/Vendor/CocoatechCore/NTSynchronousTask.m b/Vendor/CocoatechCore/NTSynchronousTask.m index f96bdbf8..3f583d7d 100644 --- a/Vendor/CocoatechCore/NTSynchronousTask.m +++ b/Vendor/CocoatechCore/NTSynchronousTask.m @@ -27,7 +27,7 @@ - (void)taskOutputAvailable:(NSNotification*)note { - self.output = [note userInfo][NSFileHandleNotificationDataItem]; + self.output = [[note userInfo] objectForKey:NSFileHandleNotificationDataItem]; self.done = YES; }