diff --git a/Sparkle/SUAutomaticUpdateAlert.m b/Sparkle/SUAutomaticUpdateAlert.m index 85cb0cbc..1119b27b 100644 --- a/Sparkle/SUAutomaticUpdateAlert.m +++ b/Sparkle/SUAutomaticUpdateAlert.m @@ -23,7 +23,7 @@ - (instancetype)initWithAppcastItem:(SUAppcastItem *)item host:(SUHost *)aHost delegate:(id)del { - self = [super initWithHost:aHost windowNibName:@"SUAutomaticUpdateAlert"]; + self = [super initWithWindowNibName:@"SUAutomaticUpdateAlert"]; if (self) { self.updateItem = item; diff --git a/Sparkle/SUStatusController.m b/Sparkle/SUStatusController.m index b1ca3b03..c7def5d5 100644 --- a/Sparkle/SUStatusController.m +++ b/Sparkle/SUStatusController.m @@ -31,7 +31,7 @@ - (instancetype)initWithHost:(SUHost *)aHost { - self = [super initWithHost:aHost windowNibName:@"SUStatus"]; + self = [super initWithWindowNibName:@"SUStatus"]; if (self) { self.host = aHost; diff --git a/Sparkle/SUUpdateAlert.m b/Sparkle/SUUpdateAlert.m index 0eb7e613..ed1da529 100644 --- a/Sparkle/SUUpdateAlert.m +++ b/Sparkle/SUUpdateAlert.m @@ -54,7 +54,7 @@ - (instancetype)initWithAppcastItem:(SUAppcastItem *)item host:(SUHost *)aHost { - self = [super initWithHost:host windowNibName:@"SUUpdateAlert"]; + self = [super initWithWindowNibName:@"SUUpdateAlert"]; if (self) { host = aHost; diff --git a/Sparkle/SUUpdatePermissionPrompt.m b/Sparkle/SUUpdatePermissionPrompt.m index 6d31cdf6..39ec63da 100644 --- a/Sparkle/SUUpdatePermissionPrompt.m +++ b/Sparkle/SUUpdatePermissionPrompt.m @@ -45,7 +45,7 @@ - (instancetype)initWithHost:(SUHost *)aHost systemProfile:(NSArray *)profile delegate:(id)d { - self = [super initWithHost:aHost windowNibName:@"SUUpdatePermissionPrompt"]; + self = [super initWithWindowNibName:@"SUUpdatePermissionPrompt"]; if (self) { host = aHost; diff --git a/Sparkle/SUWindowController.h b/Sparkle/SUWindowController.h index 0cd60191..f6af6fae 100644 --- a/Sparkle/SUWindowController.h +++ b/Sparkle/SUWindowController.h @@ -14,7 +14,7 @@ @class SUHost; @interface SUWindowController : NSWindowController // We use this instead of plain old NSWindowController initWithWindowNibName so that we'll be able to find the right path when running in a bundle loaded from another app. -- (instancetype)initWithHost:(SUHost *)host windowNibName:(NSString *)nibName; +- (instancetype)initWithWindowNibName:(NSString *)nibName; @end #endif diff --git a/Sparkle/SUWindowController.m b/Sparkle/SUWindowController.m index 874f7653..55323113 100644 --- a/Sparkle/SUWindowController.m +++ b/Sparkle/SUWindowController.m @@ -11,16 +11,9 @@ @implementation SUWindowController -- (instancetype)initWithHost:(SUHost *)host windowNibName:(NSString *)nibName +- (instancetype)initWithWindowNibName:(NSString *)nibName { - NSString *path = [[NSBundle bundleForClass:[self class]] pathForResource:nibName ofType:@"nib"]; - if (path == nil) // Slight hack to resolve issues with running Sparkle in debug configurations. - { - NSString *frameworkPath = [[[host bundle] sharedFrameworksPath] stringByAppendingPathComponent:@"Sparkle.framework"]; - NSBundle *framework = [NSBundle bundleWithPath:frameworkPath]; - path = [framework pathForResource:nibName ofType:@"nib"]; - } - self = [super initWithWindowNibPath:path owner:self]; + self = [super initWithWindowNibName:nibName owner:self]; return self; }