From 154aa1b0db8007f16fac6dcaf3a8e4c44215bfa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kornel=20Lesi=C5=84ski?= Date: Thu, 22 Oct 2015 13:54:43 +0100 Subject: [PATCH] Subclassing fixes #661 --- Sparkle/SUSystemProfiler.m | 3 ++- Sparkle/SUUpdater.m | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Sparkle/SUSystemProfiler.m b/Sparkle/SUSystemProfiler.m index 26bbfe9a..41e42b0a 100644 --- a/Sparkle/SUSystemProfiler.m +++ b/Sparkle/SUSystemProfiler.m @@ -37,7 +37,8 @@ static NSString *const SUSystemProfilerPreferredLanguageKey = @"lang"; - (NSDictionary *)modelTranslationTable { - NSString *path = [[NSBundle bundleForClass:[self class]] pathForResource:@"SUModelTranslation" ofType:@"plist"]; + // Use explicit class to use the correct bundle even when subclassed + NSString *path = [[NSBundle bundleForClass:[SUSystemProfiler class]] pathForResource:@"SUModelTranslation" ofType:@"plist"]; return [[NSDictionary alloc] initWithContentsOfFile:path]; } diff --git a/Sparkle/SUUpdater.m b/Sparkle/SUUpdater.m index 7ab7271a..c3638d97 100644 --- a/Sparkle/SUUpdater.m +++ b/Sparkle/SUUpdater.m @@ -83,6 +83,7 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults self = [super init]; if (bundle == nil) bundle = [NSBundle mainBundle]; + // Use explicit class to use the correct bundle even when subclassed self.sparkleBundle = [NSBundle bundleForClass:[SUUpdater class]]; if (!self.sparkleBundle) { SULog(@"Error: SUUpdater can't find Sparkle.framework it belongs to");