Fixing singleton initialization

//FREEBIE
pull/1/head
Frederic Jacobs 11 years ago
parent efdda2f073
commit f8d201fc52

@ -25,15 +25,21 @@
static dispatch_once_t onceToken; static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{ dispatch_once(&onceToken, ^{
sharedManager = [self new]; sharedManager = [self new];
sharedManager.missingPermissionsAlertView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"ACTION_REQUIRED_TITLE", @"") });
return sharedManager;
}
- (instancetype)init{
self = [super init];
if (self) {
self.missingPermissionsAlertView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"ACTION_REQUIRED_TITLE", @"")
message:NSLocalizedString(@"PUSH_SETTINGS_MESSAGE", @"") message:NSLocalizedString(@"PUSH_SETTINGS_MESSAGE", @"")
delegate:nil delegate:nil
cancelButtonTitle:NSLocalizedString(@"OK", @"") cancelButtonTitle:NSLocalizedString(@"OK", @"")
otherButtonTitles:nil, nil]; otherButtonTitles:nil, nil];
});
return sharedManager;
} }
return self;
}
- (void)verifyPushPermissions{ - (void)verifyPushPermissions{
if (self.isMissingMandatoryNotificationTypes || self.needToRegisterForRemoteNotifications){ if (self.isMissingMandatoryNotificationTypes || self.needToRegisterForRemoteNotifications){

Loading…
Cancel
Save