Check against self class in initialize methods

This commit is contained in:
dbeard
2016-09-01 11:41:31 -07:00
parent 77679d837f
commit eeddfdab9b
2 changed files with 7 additions and 3 deletions

View File

@@ -61,8 +61,10 @@ static NSString *bundleResourceSubdirectory = nil;
+ (void)initialize
{
// Use the mainBundle by default.
bundleResourceBundle = [NSBundle mainBundle];
if (self == [CodePush class]) {
// Use the mainBundle by default.
bundleResourceBundle = [NSBundle mainBundle];
}
}
#pragma mark - Public Obj-C API

View File

@@ -20,7 +20,9 @@ static NSString * const ServerURLConfigKey = @"serverUrl";
+ (void)initialize
{
_currentConfig = [[CodePushConfig alloc] init];
if (self == [CodePushConfig class]) {
_currentConfig = [[CodePushConfig alloc] init];
}
}
- (instancetype)init