-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSCConfig.m
87 lines (65 loc) · 1.35 KB
/
SCConfig.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
//
// Config.m
// scanorama
//
// Created by Lion User on 13/09/2012.
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//
#import "SCConfig.h"
@implementation SCConfig
@synthesize cityId;
+(id)sharedInstance {
static SCConfig *sharedInstance = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
sharedInstance = [[self alloc] init];
});
return sharedInstance;
}
-(id)init {
if(self = [super init])
cityId = [[NSNumber alloc] initWithInt:1];
return self;
}
-(void)dealloc {
}
/*
static int mySecondStatic;
+(int)mySecondStatic {
return mySecondStatic;
}
+(int) getMySecondStatic {
return mySecondStatic;
}
+(void)setMySecondStatic:(int)city{
mySecondStatic = city;
}
@synthesize cityId = _cityId;
+(int) getSelectedCityId{
return _cityId;
}
+(void) setSelectedCityId:(int)cityId{
SCConfig.cityId = cityId;
}
+(void)setMyStaticValue:(int)cityId {
}
*/
-(NSString *)getCityName {
switch ([cityId intValue]) {
case 1:
return @"Vilnius";
break;
case 2:
return @"Kaunas";
break;
case 3:
return @"Klaipėda";
break;
case 4:
return @"Šiauliai";
break;
default:
return @"Vilnius";
}
}
@end