|
@@ -13,10 +13,64 @@
|
|
|
|
|
|
|
|
@interface AppDelegate ()
|
|
@interface AppDelegate ()
|
|
|
|
|
|
|
|
|
|
+@property (nonatomic,strong) NSMutableDictionary *globalParameters;
|
|
|
|
|
+
|
|
|
@end
|
|
@end
|
|
|
|
|
|
|
|
@implementation AppDelegate
|
|
@implementation AppDelegate
|
|
|
|
|
|
|
|
|
|
+#pragma mark - Global Parameter
|
|
|
|
|
+
|
|
|
|
|
+- (NSMutableDictionary *)globalParameters {
|
|
|
|
|
+ if (!_globalParameters) {
|
|
|
|
|
+ _globalParameters = [NSMutableDictionary dictionary];
|
|
|
|
|
+ }
|
|
|
|
|
+ return _globalParameters;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+- (void)setGlobalParameter:(id)param forKey:(NSString *)key {
|
|
|
|
|
+ if (param == nil || key == nil) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ [self.globalParameters setObject:param forKey:key];
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+- (id)globalParameterForKey:(NSString *)key {
|
|
|
|
|
+ if (key == nil) {
|
|
|
|
|
+ return nil;
|
|
|
|
|
+ }
|
|
|
|
|
+ return [self.globalParameters objectForKey:key];
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+#pragma mark - Setter
|
|
|
|
|
+
|
|
|
|
|
+- (void)setUrgencyDic:(NSMutableDictionary *)urgencyDic {
|
|
|
|
|
+ _urgencyDic = urgencyDic;
|
|
|
|
|
+ [self setGlobalParameter:_urgencyDic forKey:@"urgencyDic"];
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+- (void)setCan_see_price:(bool)can_see_price {
|
|
|
|
|
+ _can_see_price = can_see_price;
|
|
|
|
|
+ [self setGlobalParameter:@(_can_see_price) forKey:@"can_see_price"];
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+- (void)setPrice_hidden:(bool)price_hidden {
|
|
|
|
|
+ _price_hidden = price_hidden;
|
|
|
|
|
+ [self setGlobalParameter:@(_price_hidden) forKey:@"price_hidden"];
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+- (void)setUser:(NSString *)user {
|
|
|
|
|
+ _user = user;
|
|
|
|
|
+ [self setGlobalParameter:_user forKey:@"user"];
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+- (void)setPassword:(NSString *)password {
|
|
|
|
|
+ _password = password;
|
|
|
|
|
+ [self setGlobalParameter:_password forKey:@"password"];
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+#pragma mark - Normal
|
|
|
|
|
|
|
|
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
|
|
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
|
|
|
// Override point for customization after application launch.
|
|
// Override point for customization after application launch.
|