Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

added localized

  • Loading branch information...
commit 30aad54a2a9440f5cb9f9b9a4c0bdc8b730d686c 1 parent bbb6138
Shaokun Wu authored
30 MyCalendar.xcodeproj/project.pbxproj
@@ -28,6 +28,7 @@
28 28 3E9C861713580A0E0083C49E /* NSDate+TKCategory.m in Sources */ = {isa = PBXBuildFile; fileRef = 3E9C861613580A0E0083C49E /* NSDate+TKCategory.m */; };
29 29 3E9C86221358261C0083C49E /* NSDate+DateInformation.m in Sources */ = {isa = PBXBuildFile; fileRef = 3E9C86211358261C0083C49E /* NSDate+DateInformation.m */; };
30 30 3E9C8626135829500083C49E /* CalendarButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 3E9C8625135829500083C49E /* CalendarButton.m */; };
  31 + 3EF016A413583E45006BE7D9 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 3EF016A613583E45006BE7D9 /* Localizable.strings */; };
31 32 /* End PBXBuildFile section */
32 33
33 34 /* Begin PBXFileReference section */
@@ -63,6 +64,8 @@
63 64 3E9C86241358294F0083C49E /* CalendarButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CalendarButton.h; sourceTree = "<group>"; };
64 65 3E9C8625135829500083C49E /* CalendarButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CalendarButton.m; sourceTree = "<group>"; };
65 66 3E9C8627135829F20083C49E /* CalendarViewDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CalendarViewDelegate.h; sourceTree = "<group>"; };
  67 + 3EF016A513583E45006BE7D9 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; };
  68 + 3EF016A713583E52006BE7D9 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Localizable.strings"; sourceTree = "<group>"; };
66 69 /* End PBXFileReference section */
67 70
68 71 /* Begin PBXFrameworksBuildPhase section */
@@ -109,9 +112,7 @@
109 112 3E9C85E1135806740083C49E /* MyCalendar */ = {
110 113 isa = PBXGroup;
111 114 children = (
112   - 3E9C8601135806D70083C49E /* CalendarView.xib */,
113   - 3E9C85ED135806740083C49E /* MainWindow.xib */,
114   - 3E9C85F3135806740083C49E /* MyCalendarViewController.xib */,
  115 + 3EF0169813583D27006BE7D9 /* Resources */,
115 116 3E9C862813582A0A0083C49E /* Images */,
116 117 3E9C8623135829240083C49E /* References */,
117 118 3E9C86201358261C0083C49E /* NSDate+DateInformation.h */,
@@ -165,6 +166,17 @@
165 166 name = Images;
166 167 sourceTree = "<group>";
167 168 };
  169 + 3EF0169813583D27006BE7D9 /* Resources */ = {
  170 + isa = PBXGroup;
  171 + children = (
  172 + 3E9C8601135806D70083C49E /* CalendarView.xib */,
  173 + 3E9C85ED135806740083C49E /* MainWindow.xib */,
  174 + 3E9C85F3135806740083C49E /* MyCalendarViewController.xib */,
  175 + 3EF016A613583E45006BE7D9 /* Localizable.strings */,
  176 + );
  177 + name = Resources;
  178 + sourceTree = "<group>";
  179 + };
168 180 /* End PBXGroup section */
169 181
170 182 /* Begin PBXNativeTarget section */
@@ -196,6 +208,7 @@
196 208 hasScannedForEncodings = 0;
197 209 knownRegions = (
198 210 en,
  211 + "zh-Hans",
199 212 );
200 213 mainGroup = 3E9C85CC135806730083C49E;
201 214 productRefGroup = 3E9C85D8135806740083C49E /* Products */;
@@ -222,6 +235,7 @@
222 235 3E9C8610135808690083C49E /* todayselected.png in Resources */,
223 236 3E9C86131358087C0083C49E /* leftarrow.png in Resources */,
224 237 3E9C86141358087C0083C49E /* rightarrow.png in Resources */,
  238 + 3EF016A413583E45006BE7D9 /* Localizable.strings in Resources */,
225 239 );
226 240 runOnlyForDeploymentPostprocessing = 0;
227 241 };
@@ -270,6 +284,15 @@
270 284 name = MyCalendarViewController.xib;
271 285 sourceTree = "<group>";
272 286 };
  287 + 3EF016A613583E45006BE7D9 /* Localizable.strings */ = {
  288 + isa = PBXVariantGroup;
  289 + children = (
  290 + 3EF016A513583E45006BE7D9 /* en */,
  291 + 3EF016A713583E52006BE7D9 /* zh-Hans */,
  292 + );
  293 + name = Localizable.strings;
  294 + sourceTree = "<group>";
  295 + };
273 296 /* End PBXVariantGroup section */
274 297
275 298 /* Begin XCBuildConfiguration section */
@@ -352,6 +375,7 @@
352 375 3E9C85FA135806740083C49E /* Release */,
353 376 );
354 377 defaultConfigurationIsVisible = 0;
  378 + defaultConfigurationName = Release;
355 379 };
356 380 /* End XCConfigurationList section */
357 381 };
10,528 MyCalendar.xcodeproj/project.xcworkspace/xcuserdata/shaokun.xcuserdatad/UserInterfaceState.xcuserstate
7,138 additions, 3,390 deletions not shown
5 MyCalendar.xcodeproj/xcuserdata/shaokun.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist
... ... @@ -0,0 +1,5 @@
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<Bucket
  3 + type = "1"
  4 + version = "1.0">
  5 +</Bucket>
BIN  MyCalendar/.DS_Store
Binary file not shown
1  MyCalendar/CalendarButton.m
@@ -13,6 +13,7 @@ + (CalendarButton *)createCalendarButton:(NSDate *)date gray:(BOOL)gray {
13 13 CalendarButton *button = [CalendarButton buttonWithType:UIButtonTypeCustom];
14 14 button.date = date;
15 15 button.alpha = gray ? 0.7 : 0.8;
  16 + button.titleLabel.font = [UIFont systemFontOfSize:14.0];
16 17 [button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
17 18 [button setTitle:[NSString stringWithFormat:@"%d", [comps day]] forState:UIControlStateNormal];
18 19 // [button setTitle:[NSString stringWithFormat:@"%d", [date dateInformation].day] forState:UIControlStateNormal];
60 MyCalendar/CalendarView.m
@@ -12,23 +12,23 @@ - (void)setSelectedMonth:(int)month {
12 12 monthLabel.text = [NSString stringWithFormat:@"%d", month];
13 13 }
14 14
15   -- (int)monthOfDate:(NSDate *)date {
16   - unsigned unitFlags = NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit | NSWeekdayCalendarUnit;
17   - NSCalendar *calendar = [NSCalendar currentCalendar];
18   -
19   - NSDateComponents *comps = [calendar components:unitFlags fromDate:date];
20   -
21   - return [comps month];
22   -}
23   -
24   -- (int)yearOfDate:(NSDate *)date {
25   - unsigned unitFlags = NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit | NSWeekdayCalendarUnit;
26   - NSCalendar *calendar = [NSCalendar currentCalendar];
27   -
28   - NSDateComponents *comps = [calendar components:unitFlags fromDate:date];
29   -
30   - return [comps year];
31   -}
  15 +//- (int)monthOfDate:(NSDate *)date {
  16 +// unsigned unitFlags = NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit | NSWeekdayCalendarUnit;
  17 +// NSCalendar *calendar = [NSCalendar currentCalendar];
  18 +//
  19 +// NSDateComponents *comps = [calendar components:unitFlags fromDate:date];
  20 +//
  21 +// return [comps month];
  22 +//}
  23 +//
  24 +//- (int)yearOfDate:(NSDate *)date {
  25 +// unsigned unitFlags = NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit | NSWeekdayCalendarUnit;
  26 +// NSCalendar *calendar = [NSCalendar currentCalendar];
  27 +//
  28 +// NSDateComponents *comps = [calendar components:unitFlags fromDate:date];
  29 +//
  30 +// return [comps year];
  31 +//}
32 32
33 33 - (void)updateButtons {
34 34 for (UIView *subview in gridView.subviews) {
@@ -61,13 +61,21 @@ - (void)updateButtons {
61 61 inUnit:NSMonthCalendarUnit
62 62 forDate:previousDate];
63 63
64   - NSArray *titles = [NSArray arrayWithObjects:@"一", @"二", @"三", @"四", @"五", @"六", @"日", nil];
  64 + NSArray *titles = [NSArray arrayWithObjects:
  65 + NSLocalizedString(@"一", nil),
  66 + NSLocalizedString(@"二", nil),
  67 + NSLocalizedString(@"三", nil),
  68 + NSLocalizedString(@"四", nil),
  69 + NSLocalizedString(@"五", nil),
  70 + NSLocalizedString(@"六", nil),
  71 + NSLocalizedString(@"日", nil), nil];
65 72
66 73 for (NSString *title in titles) {
67 74 UILabel *label = [[UILabel new] autorelease];
68 75 label.text = title;
69 76 label.textAlignment = UITextAlignmentCenter;
70   - label.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"datecell.png"]];
  77 + label.font = [UIFont systemFontOfSize:12.0];
  78 +// label.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"datecell.png"]];
71 79 label.alpha = 0.8;
72 80
73 81 [gridView addSubview:label];
@@ -86,8 +94,8 @@ - (void)updateButtons {
86 94
87 95 for (int d = 0; d < (weekday - 2); d++) {
88 96 comps.day = lastDay++;
89   - comps.month = [self monthOfDate:previousDate];
90   - comps.year = [self yearOfDate:previousDate];
  97 + comps.month = [previousDate dateInformation].month;
  98 + comps.year = [previousDate year];
91 99 date = [gregorian dateFromComponents:comps];
92 100 CalendarButton *button = [CalendarButton createCalendarButton:date gray:YES];
93 101 [button addTarget:self action:@selector(dateSelected:) forControlEvents:UIControlEventTouchUpInside];
@@ -111,8 +119,8 @@ - (void)updateButtons {
111 119 int n = 49 - gridView.subviews.count;
112 120 for (int d = 0; d < n; d++) {
113 121 comps.day = d + 1;
114   - comps.month = [self monthOfDate:nextDate];
115   - comps.year = [self yearOfDate:nextDate];;
  122 + comps.month = [nextDate dateInformation].month;
  123 + comps.year = [nextDate dateInformation].year;
116 124 date = [gregorian dateFromComponents:comps];
117 125
118 126 CalendarButton *button = [CalendarButton createCalendarButton:date gray:YES];
@@ -130,8 +138,8 @@ - (void)awakeFromNib {
130 138 gridView.margin = 0;
131 139
132 140 NSDate *now = [NSDate date];
133   - int month = [self monthOfDate:now];
134   - int year = [self yearOfDate:now];
  141 + int month = [now dateInformation].month;
  142 + int year = [now dateInformation].year;
135 143
136 144 self.selectedYear = year;
137 145 self.selectedMonth = month;
@@ -155,7 +163,7 @@ - (IBAction)selectPreviousMonth:(id)sender {
155 163 - (IBAction)selectNextMonth:(id)sender {
156 164 int month = self.selectedMonth + 1;
157 165
158   - if (month < 12) {
  166 + if (month <= 12) {
159 167 self.selectedMonth = month;
160 168 } else {
161 169 self.selectedMonth = 1;
2  MyCalendar/MyCalendarViewController.h
@@ -11,6 +11,8 @@
11 11
12 12 @interface MyCalendarViewController : UIViewController <CalendarViewDelegate> {
13 13 CalendarView *calendarView;
  14 + IBOutlet UILabel *selectedDateLabel;
  15 + IBOutlet UILabel *selectedYearLabel;
14 16 }
15 17
16 18 @end
24 MyCalendar/MyCalendarViewController.m
@@ -11,12 +11,15 @@
11 11 @implementation MyCalendarViewController
12 12
13 13 - (void)calendarViewDateSelected:(CalendarView *)calendarView date:(NSDate *)date {
14   - NSLog(@"%@", date);
  14 + selectedDateLabel.text = [NSString stringWithFormat:@"%@", date];
  15 +// NSLog(@"%@", date);
15 16 }
16 17
17 18 - (void)dealloc
18 19 {
19 20 [calendarView release];
  21 + [selectedDateLabel release];
  22 + [selectedYearLabel release];
20 23 [super dealloc];
21 24 }
22 25
@@ -44,15 +47,26 @@ - (void)viewDidLoad
44 47 frame.origin.y = 53;
45 48 calendarView.frame = frame;
46 49 calendarView.delegate = self;
  50 +
  51 + [calendarView addObserver:self forKeyPath:@"selectedMonth" options:NSKeyValueObservingOptionNew context:nil];
  52 +
  53 + [calendarView addObserver:self forKeyPath:@"selectedYear" options:NSKeyValueObservingOptionNew context:nil];
47 54 break;
48 55 }
49 56 }
50 57
51 58 [self.view addSubview:calendarView];
  59 +
  60 + selectedYearLabel.text = [NSString stringWithFormat:@"Year of %d", calendarView.selectedYear];
  61 +
52 62 }
53 63
54 64 - (void)viewDidUnload
55 65 {
  66 + [selectedDateLabel release];
  67 + selectedDateLabel = nil;
  68 + [selectedYearLabel release];
  69 + selectedYearLabel = nil;
56 70 [super viewDidUnload];
57 71 // Release any retained subviews of the main view.
58 72 // e.g. self.myOutlet = nil;
@@ -64,4 +78,12 @@ - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interface
64 78 return (interfaceOrientation == UIInterfaceOrientationPortrait);
65 79 }
66 80
  81 +#pragma KVO
  82 +
  83 +- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
  84 +{
  85 + NSLog(@"%@", keyPath);
  86 + selectedYearLabel.text = [NSString stringWithFormat:@"Year of %d", calendarView.selectedYear];
  87 +}
  88 +
67 89 @end
3  MyCalendar/NSDate+DateInformation.h
@@ -24,6 +24,9 @@ typedef struct DateInformation DateInformation;
24 24 @interface NSDate (DateInformation)
25 25
26 26
  27 +- (int)day;
  28 +- (int)year;
  29 +
27 30 - (DateInformation) dateInformation;
28 31 - (DateInformation) dateInformationWithTimeZone:(NSTimeZone *)tz;
29 32 - (NSDate *) dateByAddingDays:(NSUInteger)days;
12 MyCalendar/NSDate+DateInformation.m
@@ -11,6 +11,18 @@
11 11
12 12 @implementation NSDate (DateInformation)
13 13
  14 +- (int)day {
  15 + return [self dateInformation].day;
  16 +}
  17 +
  18 +- (int)month {
  19 + return [self dateInformation].month;
  20 +}
  21 +
  22 +- (int)year {
  23 + return [self dateInformation].year;
  24 +}
  25 +
14 26 - (DateInformation) dateInformation {
15 27 return [self dateInformationWithTimeZone:[NSTimeZone systemTimeZone]];
16 28 }
BIN  MyCalendar/en.lproj/Localizable.strings
Binary file not shown
157 MyCalendar/en.lproj/MyCalendarViewController.xib
... ... @@ -1,18 +1,20 @@
1 1 <?xml version="1.0" encoding="UTF-8"?>
2 2 <archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
3 3 <data>
4   - <int key="IBDocument.SystemTarget">800</int>
5   - <string key="IBDocument.SystemVersion">10C540</string>
6   - <string key="IBDocument.InterfaceBuilderVersion">759</string>
7   - <string key="IBDocument.AppKitVersion">1038.25</string>
8   - <string key="IBDocument.HIToolboxVersion">458.00</string>
  4 + <int key="IBDocument.SystemTarget">1056</int>
  5 + <string key="IBDocument.SystemVersion">10J869</string>
  6 + <string key="IBDocument.InterfaceBuilderVersion">1305</string>
  7 + <string key="IBDocument.AppKitVersion">1038.35</string>
  8 + <string key="IBDocument.HIToolboxVersion">461.00</string>
9 9 <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
10 10 <string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
11   - <string key="NS.object.0">77</string>
  11 + <string key="NS.object.0">300</string>
12 12 </object>
13   - <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
  13 + <object class="NSArray" key="IBDocument.IntegratedClassDependencies">
14 14 <bool key="EncodedWithXMLCoder">YES</bool>
15   - <integer value="6"/>
  15 + <string>IBProxyObject</string>
  16 + <string>IBUIView</string>
  17 + <string>IBUILabel</string>
16 18 </object>
17 19 <object class="NSArray" key="IBDocument.PluginDependencies">
18 20 <bool key="EncodedWithXMLCoder">YES</bool>
@@ -23,9 +25,7 @@
23 25 <object class="NSArray" key="dict.sortedKeys" id="0">
24 26 <bool key="EncodedWithXMLCoder">YES</bool>
25 27 </object>
26   - <object class="NSMutableArray" key="dict.values">
27   - <bool key="EncodedWithXMLCoder">YES</bool>
28   - </object>
  28 + <reference key="dict.values" ref="0"/>
29 29 </object>
30 30 <object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
31 31 <bool key="EncodedWithXMLCoder">YES</bool>
@@ -40,8 +40,58 @@
40 40 <object class="IBUIView" id="774585933">
41 41 <reference key="NSNextResponder"/>
42 42 <int key="NSvFlags">274</int>
43   - <string key="NSFrameSize">{320, 460}</string>
  43 + <object class="NSMutableArray" key="NSSubviews">
  44 + <bool key="EncodedWithXMLCoder">YES</bool>
  45 + <object class="IBUILabel" id="175396561">
  46 + <reference key="NSNextResponder" ref="774585933"/>
  47 + <int key="NSvFlags">292</int>
  48 + <string key="NSFrame">{{40, 28}, {241, 21}}</string>
  49 + <reference key="NSSuperview" ref="774585933"/>
  50 + <reference key="NSWindow"/>
  51 + <reference key="NSNextKeyView"/>
  52 + <bool key="IBUIOpaque">NO</bool>
  53 + <bool key="IBUIClipsSubviews">YES</bool>
  54 + <int key="IBUIContentMode">7</int>
  55 + <bool key="IBUIUserInteractionEnabled">NO</bool>
  56 + <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
  57 + <string key="IBUIText">No date selected yet...</string>
  58 + <object class="NSFont" key="IBUIFont">
  59 + <string key="NSName">Helvetica-Bold</string>
  60 + <double key="NSSize">14</double>
  61 + <int key="NSfFlags">16</int>
  62 + </object>
  63 + <object class="NSColor" key="IBUITextColor" id="374898675">
  64 + <int key="NSColorSpace">1</int>
  65 + <bytes key="NSRGB">MCAwIDAAA</bytes>
  66 + </object>
  67 + <nil key="IBUIHighlightedColor"/>
  68 + <int key="IBUIBaselineAdjustment">1</int>
  69 + <float key="IBUIMinimumFontSize">10</float>
  70 + <int key="IBUITextAlignment">1</int>
  71 + </object>
  72 + <object class="IBUILabel" id="189716331">
  73 + <reference key="NSNextResponder" ref="774585933"/>
  74 + <int key="NSvFlags">292</int>
  75 + <string key="NSFrame">{{102, 7}, {116, 21}}</string>
  76 + <reference key="NSSuperview" ref="774585933"/>
  77 + <reference key="NSWindow"/>
  78 + <reference key="NSNextKeyView" ref="175396561"/>
  79 + <bool key="IBUIOpaque">NO</bool>
  80 + <bool key="IBUIClipsSubviews">YES</bool>
  81 + <int key="IBUIContentMode">7</int>
  82 + <bool key="IBUIUserInteractionEnabled">NO</bool>
  83 + <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
  84 + <string key="IBUIText"/>
  85 + <reference key="IBUITextColor" ref="374898675"/>
  86 + <nil key="IBUIHighlightedColor"/>
  87 + <int key="IBUIBaselineAdjustment">1</int>
  88 + <float key="IBUIMinimumFontSize">10</float>
  89 + </object>
  90 + </object>
  91 + <string key="NSFrame">{{0, 20}, {320, 460}}</string>
44 92 <reference key="NSSuperview"/>
  93 + <reference key="NSWindow"/>
  94 + <reference key="NSNextKeyView" ref="189716331"/>
45 95 <object class="NSColor" key="IBUIBackgroundColor">
46 96 <int key="NSColorSpace">3</int>
47 97 <bytes key="NSWhite">MC43NQA</bytes>
@@ -65,6 +115,22 @@
65 115 </object>
66 116 <int key="connectionID">7</int>
67 117 </object>
  118 + <object class="IBConnectionRecord">
  119 + <object class="IBCocoaTouchOutletConnection" key="connection">
  120 + <string key="label">selectedDateLabel</string>
  121 + <reference key="source" ref="372490531"/>
  122 + <reference key="destination" ref="175396561"/>
  123 + </object>
  124 + <int key="connectionID">9</int>
  125 + </object>
  126 + <object class="IBConnectionRecord">
  127 + <object class="IBCocoaTouchOutletConnection" key="connection">
  128 + <string key="label">selectedYearLabel</string>
  129 + <reference key="source" ref="372490531"/>
  130 + <reference key="destination" ref="189716331"/>
  131 + </object>
  132 + <int key="connectionID">11</int>
  133 + </object>
68 134 </object>
69 135 <object class="IBMutableOrderedSet" key="objectRecords">
70 136 <object class="NSArray" key="orderedObjects">
@@ -89,8 +155,23 @@
89 155 <object class="IBObjectRecord">
90 156 <int key="objectID">6</int>
91 157 <reference key="object" ref="774585933"/>
  158 + <object class="NSMutableArray" key="children">
  159 + <bool key="EncodedWithXMLCoder">YES</bool>
  160 + <reference ref="175396561"/>
  161 + <reference ref="189716331"/>
  162 + </object>
92 163 <reference key="parent" ref="0"/>
93 164 </object>
  165 + <object class="IBObjectRecord">
  166 + <int key="objectID">8</int>
  167 + <reference key="object" ref="175396561"/>
  168 + <reference key="parent" ref="774585933"/>
  169 + </object>
  170 + <object class="IBObjectRecord">
  171 + <int key="objectID">10</int>
  172 + <reference key="object" ref="189716331"/>
  173 + <reference key="parent" ref="774585933"/>
  174 + </object>
94 175 </object>
95 176 </object>
96 177 <object class="NSMutableDictionary" key="flattenedProperties">
@@ -99,34 +180,34 @@
99 180 <bool key="EncodedWithXMLCoder">YES</bool>
100 181 <string>-1.CustomClassName</string>
101 182 <string>-2.CustomClassName</string>
  183 + <string>10.IBPluginDependency</string>
102 184 <string>6.IBEditorWindowLastContentRect</string>
103 185 <string>6.IBPluginDependency</string>
  186 + <string>8.IBPluginDependency</string>
104 187 </object>
105 188 <object class="NSMutableArray" key="dict.values">
106 189 <bool key="EncodedWithXMLCoder">YES</bool>
107 190 <string>MyCalendarViewController</string>
108 191 <string>UIResponder</string>
  192 + <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
109 193 <string>{{239, 654}, {320, 480}}</string>
110 194 <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
  195 + <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
111 196 </object>
112 197 </object>
113 198 <object class="NSMutableDictionary" key="unlocalizedProperties">
114 199 <bool key="EncodedWithXMLCoder">YES</bool>
115 200 <reference key="dict.sortedKeys" ref="0"/>
116   - <object class="NSMutableArray" key="dict.values">
117   - <bool key="EncodedWithXMLCoder">YES</bool>
118   - </object>
  201 + <reference key="dict.values" ref="0"/>
119 202 </object>
120 203 <nil key="activeLocalization"/>
121 204 <object class="NSMutableDictionary" key="localizations">
122 205 <bool key="EncodedWithXMLCoder">YES</bool>
123 206 <reference key="dict.sortedKeys" ref="0"/>
124   - <object class="NSMutableArray" key="dict.values">
125   - <bool key="EncodedWithXMLCoder">YES</bool>
126   - </object>
  207 + <reference key="dict.values" ref="0"/>
127 208 </object>
128 209 <nil key="sourceID"/>
129   - <int key="maxID">7</int>
  210 + <int key="maxID">11</int>
130 211 </object>
131 212 <object class="IBClassDescriber" key="IBDocument.Classes">
132 213 <object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -134,9 +215,41 @@
134 215 <object class="IBPartialClassDescription">
135 216 <string key="className">MyCalendarViewController</string>
136 217 <string key="superclassName">UIViewController</string>
  218 + <object class="NSMutableDictionary" key="outlets">
  219 + <bool key="EncodedWithXMLCoder">YES</bool>
  220 + <object class="NSArray" key="dict.sortedKeys">
  221 + <bool key="EncodedWithXMLCoder">YES</bool>
  222 + <string>selectedDateLabel</string>
  223 + <string>selectedYearLabel</string>
  224 + </object>
  225 + <object class="NSMutableArray" key="dict.values">
  226 + <bool key="EncodedWithXMLCoder">YES</bool>
  227 + <string>UILabel</string>
  228 + <string>UILabel</string>
  229 + </object>
  230 + </object>
  231 + <object class="NSMutableDictionary" key="toOneOutletInfosByName">
  232 + <bool key="EncodedWithXMLCoder">YES</bool>
  233 + <object class="NSArray" key="dict.sortedKeys">
  234 + <bool key="EncodedWithXMLCoder">YES</bool>
  235 + <string>selectedDateLabel</string>
  236 + <string>selectedYearLabel</string>
  237 + </object>
  238 + <object class="NSMutableArray" key="dict.values">
  239 + <bool key="EncodedWithXMLCoder">YES</bool>
  240 + <object class="IBToOneOutletInfo">
  241 + <string key="name">selectedDateLabel</string>
  242 + <string key="candidateClassName">UILabel</string>
  243 + </object>
  244 + <object class="IBToOneOutletInfo">
  245 + <string key="name">selectedYearLabel</string>
  246 + <string key="candidateClassName">UILabel</string>
  247 + </object>
  248 + </object>
  249 + </object>
137 250 <object class="IBClassDescriptionSource" key="sourceIdentifier">
138 251 <string key="majorKey">IBProjectSource</string>
139   - <string key="minorKey">MyCalendarViewController.h</string>
  252 + <string key="minorKey">./Classes/MyCalendarViewController.h</string>
140 253 </object>
141 254 </object>
142 255 </object>
@@ -148,9 +261,7 @@
148 261 <integer value="3100" key="NS.object.0"/>
149 262 </object>
150 263 <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
151   - <string key="IBDocument.LastKnownRelativeProjectPath">MyCalendar.xcodeproj</string>
152 264 <int key="IBDocument.defaultPropertyAccessControl">3</int>
153   - <string key="IBCocoaTouchPluginVersion">77</string>
154   - <nil key="IBCocoaTouchSimulationTargetRuntimeIdentifier"/>
  265 + <string key="IBCocoaTouchPluginVersion">300</string>
155 266 </data>
156 267 </archive>
15 MyCalendar/zh-Hans.lproj/Localizable.strings
... ... @@ -0,0 +1,15 @@
  1 +/*
  2 +genstrings -o MyCalendar/en.lproj/ MyCalendar/*.m
  3 +
  4 +
  5 +All localizable strings in code should be externalized and referenced using NSLocalizedString.
  6 +Create a Localizable.strings file, run from the project root, where "Classes/*.m" is where your classes files are:
  7 +genstrings -o English.lproj Classes/*.m
  8 +This will create a file in the root of your project.
  9 +Drag this from the Finder into your project, select "UFT-16" and "Do not copy".
  10 +Right click on the "Localizable.strings" and "Get Info".
  11 +Under the "General Tab" there should be "Localizations" with your default local language.
  12 +At the bottom of the window should be a "Add Localization" button, clicking this will allow you to add additional Localizations.
  13 +To append new keys rather then replace the whole file:
  14 +genstrings -o English.lproj *.m Classes/*.m
  15 +*/

0 comments on commit 30aad54

Please sign in to comment.
Something went wrong with that request. Please try again.