From 79511c982ae39718de5963b093c37e2a3290d112 Mon Sep 17 00:00:00 2001 From: Dave Wood Date: Sun, 25 Mar 2018 23:04:14 -0400 Subject: [PATCH 1/2] =?UTF-8?q?Silence=20=E2=80=98decodeObjectOfClass:forK?= =?UTF-8?q?ey:=20is=20only=20available=20on=20macOS=2010.8=E2=80=99=20Xcod?= =?UTF-8?q?e=20warnings,=20similar=20to=20commit=20ea9496918843fd6c7796c0b?= =?UTF-8?q?957be245fe5806aa1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sparkle/SPUDownloadData.m | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/Sparkle/SPUDownloadData.m b/Sparkle/SPUDownloadData.m index 0d090dbe..e769dd50 100755 --- a/Sparkle/SPUDownloadData.m +++ b/Sparkle/SPUDownloadData.m @@ -52,16 +52,20 @@ static NSString *SPUDownloadMIMETypeKey = @"SPUDownloadMIMEType"; - (nullable instancetype)initWithCoder:(NSCoder *)decoder { - NSData *data = [decoder decodeObjectOfClass:[NSData class] forKey:SPUDownloadDataKey]; - if (data == nil) { - return nil; + if (@available(macOS 10.8, *)) { + NSData *data = [decoder decodeObjectOfClass:[NSData class] forKey:SPUDownloadDataKey]; + if (data == nil) { + return nil; + } + + NSString *textEncodingName = [decoder decodeObjectOfClass:[NSString class] forKey:SPUDownloadTextEncodingKey]; + + NSString *MIMEType = [decoder decodeObjectOfClass:[NSString class] forKey:SPUDownloadMIMETypeKey]; + + return [self initWithData:data textEncodingName:textEncodingName MIMEType:MIMEType]; + } else { + abort(); // Not used on 10.7 } - - NSString *textEncodingName = [decoder decodeObjectOfClass:[NSString class] forKey:SPUDownloadTextEncodingKey]; - - NSString *MIMEType = [decoder decodeObjectOfClass:[NSString class] forKey:SPUDownloadMIMETypeKey]; - - return [self initWithData:data textEncodingName:textEncodingName MIMEType:MIMEType]; } @end From ad863775db301b7f8418c60d64b58c54ca58a75a Mon Sep 17 00:00:00 2001 From: Dave Wood Date: Sun, 25 Mar 2018 23:05:37 -0400 Subject: [PATCH 2/2] =?UTF-8?q?Silence=20=E2=80=98This=20block=20declarati?= =?UTF-8?q?on=20is=20not=20a=20prototype=E2=80=99=20Xcode=20warning?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sparkle/SUUIBasedUpdateDriver.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sparkle/SUUIBasedUpdateDriver.m b/Sparkle/SUUIBasedUpdateDriver.m index e65b845d..19370652 100644 --- a/Sparkle/SUUIBasedUpdateDriver.m +++ b/Sparkle/SUUIBasedUpdateDriver.m @@ -304,7 +304,7 @@ - (void)abortUpdateWithError:(NSError *)error { - void (^callback)() = ^{ + void (^callback)(void) = ^{ if (self.showErrors) { NSAlert *alert = [[NSAlert alloc] init]; alert.messageText = SULocalizedString(@"Update Error!", nil);