From 3ab4fb6eaf9f69977d56e37d582f98ac444f45c0 Mon Sep 17 00:00:00 2001 From: Andreas Linde Date: Sat, 21 Jul 2012 23:26:14 +0200 Subject: [PATCH] Make module managers readonly and change another property to proper naming --- Classes/BITHockeyManager.h | 6 +++--- Classes/BITHockeyManager.m | 18 +++++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Classes/BITHockeyManager.h b/Classes/BITHockeyManager.h index b34d5bc19e..e4d0682d66 100644 --- a/Classes/BITHockeyManager.h +++ b/Classes/BITHockeyManager.h @@ -47,14 +47,14 @@ #pragma mark - Public Properties -@property (nonatomic, retain) BITCrashManager *crashManager; +@property (nonatomic, retain, readonly) BITCrashManager *crashManager; -@property (nonatomic, retain) BITUpdateManager *updateManager; +@property (nonatomic, retain, readonly) BITUpdateManager *updateManager; // if YES the app is installed from the app store // if NO the app is installed via ad-hoc or enterprise distribution -@property (nonatomic, readonly) BOOL isAppStoreEnvironment; +@property (nonatomic, readonly, getter=isAppStoreEnvironment) BOOL appStoreEnvironment; // Enable debug logging; ONLY ENABLE THIS FOR DEBUGGING! // diff --git a/Classes/BITHockeyManager.m b/Classes/BITHockeyManager.m index 2f472d0118..8f4a0fc915 100644 --- a/Classes/BITHockeyManager.m +++ b/Classes/BITHockeyManager.m @@ -45,7 +45,7 @@ @synthesize crashManager = _crashManager; @synthesize updateManager = _updateManager; -@synthesize isAppStoreEnvironment = _isAppStoreEnvironment; +@synthesize appStoreEnvironment = _appStoreEnvironment; #pragma mark - Public Class Methods @@ -64,7 +64,7 @@ - (id) init { if ((self = [super init])) { - _isAppStoreEnvironment = NO; + _appStoreEnvironment = NO; _startManagerIsInvoked = NO; [self performSelector:@selector(validateStartManagerIsInvoked) withObject:nil afterDelay:0.0f]; @@ -124,7 +124,7 @@ - (void)validateStartManagerIsInvoked { - if (_validAppIdentifier && !_isAppStoreEnvironment) { + if (_validAppIdentifier && !_appStoreEnvironment) { if (!_startManagerIsInvoked) { NSLog(@"ERROR: You did not call [[BITHockeyManager sharedHockeyManager] startManager] to startup the HockeySDK! Please do so after setting up all properties. The SDK is NOT running."); } @@ -140,7 +140,7 @@ delegateResult = [(NSObject *)delegate shouldUseLiveIdenfitier]; } - return (delegateResult) || (_isAppStoreEnvironment); + return (delegateResult) || (_appStoreEnvironment); } - (void)initializeModules { @@ -150,23 +150,23 @@ // check if we are really not in an app store environment if ([[NSBundle mainBundle] pathForResource:@"embedded" ofType:@"mobileprovision"]) { - _isAppStoreEnvironment = NO; + _appStoreEnvironment = NO; } else { - _isAppStoreEnvironment = YES; + _appStoreEnvironment = YES; } #if TARGET_IPHONE_SIMULATOR - _isAppStoreEnvironment = NO; + _appStoreEnvironment = NO; #endif _startManagerIsInvoked = NO; if (_validAppIdentifier) { BITHockeyLog(@"Setup CrashManager"); - self.crashManager = [[[BITCrashManager alloc] initWithAppIdentifier:_appIdentifier] autorelease]; + _crashManager = [[BITCrashManager alloc] initWithAppIdentifier:_appIdentifier]; BITHockeyLog(@"Setup UpdateManager"); - self.updateManager = [[[BITUpdateManager alloc] initWithAppIdentifier:_appIdentifier isAppStoreEnvironemt:_isAppStoreEnvironment] autorelease]; + _updateManager = [[BITUpdateManager alloc] initWithAppIdentifier:_appIdentifier isAppStoreEnvironemt:_appStoreEnvironment]; // Only if JMC is part of the project if ([[self class] isJMCPresent]) {