Skip to content

Commit c2302d3

Browse files
committed
Added test code for sub class of CameraViewController.
1 parent 1b22d06 commit c2302d3

File tree

9 files changed

+935
-802
lines changed

9 files changed

+935
-802
lines changed

cv.xcodeproj/project.xcworkspace/xcuserdata/sonson.xcuserdatad/UserInterfaceState.xcuserstate

+751-738
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cv/CameraViewController.m

-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ - (void)viewWillAppear:(BOOL)animated {
9494
previewLayer.frame = CGRectMake(0, 0, width, height);
9595
[self.view.layer addSublayer:previewLayer];
9696
[session startRunning];
97-
9897
}
9998

10099
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {

cv/cvAppDelegate.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
@class cvViewController;
1212

1313
@interface cvAppDelegate : NSObject <UIApplicationDelegate> {
14-
14+
IBOutlet UIViewController *subViewController;
1515
}
1616

1717
@property (nonatomic, retain) IBOutlet UIWindow *window;

cv/cvAppDelegate.m

+6-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
2121
{
2222
// Override point for customization after application launch.
2323

24-
self.window.rootViewController = self.viewController;
24+
// test pattern 1
25+
// self.window.rootViewController = self.viewController;
26+
27+
// test pattern 2
28+
self.window.rootViewController = subViewController;
29+
2530
[self.window makeKeyAndVisible];
2631
return YES;
2732
}

cv/cvViewController.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#import <UIKit/UIKit.h>
1010

1111
@interface cvViewController : UIViewController {
12-
1312
}
14-
13+
- (IBAction)openCameraViewController:(id)sender;
1514
@end

cv/cvViewController.m

+6-34
Original file line numberDiff line numberDiff line change
@@ -8,42 +8,14 @@
88

99
#import "cvViewController.h"
1010

11-
@implementation cvViewController
12-
13-
- (void)dealloc
14-
{
15-
[super dealloc];
16-
}
17-
18-
- (void)didReceiveMemoryWarning
19-
{
20-
// Releases the view if it doesn't have a superview.
21-
[super didReceiveMemoryWarning];
22-
23-
// Release any cached data, images, etc that aren't in use.
24-
}
11+
#import "CameraViewController.h"
2512

26-
#pragma mark - View lifecycle
27-
28-
/*
29-
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
30-
- (void)viewDidLoad
31-
{
32-
[super viewDidLoad];
33-
}
34-
*/
35-
36-
- (void)viewDidUnload
37-
{
38-
[super viewDidUnload];
39-
// Release any retained subviews of the main view.
40-
// e.g. self.myOutlet = nil;
41-
}
13+
@implementation cvViewController
4214

43-
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
44-
{
45-
// Return YES for supported orientations
46-
return (interfaceOrientation == UIInterfaceOrientationPortrait);
15+
- (IBAction)openCameraViewController:(id)sender {
16+
CameraViewController *controller = [[CameraViewController alloc] initWithNibName:nil bundle:nil];
17+
[self presentModalViewController:controller animated:YES];
18+
[controller release];
4719
}
4820

4921
@end

cv/en.lproj/MainWindow-iPad.xib

+44-1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,17 @@
4141
<object class="IBUICustomObject" id="664661524">
4242
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
4343
</object>
44+
<object class="IBUIViewController" id="265684258">
45+
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics">
46+
<int key="IBUIStatusBarStyle">2</int>
47+
</object>
48+
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
49+
<int key="IBUIInterfaceOrientation">1</int>
50+
<int key="interfaceOrientation">1</int>
51+
</object>
52+
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
53+
<bool key="IBUIHorizontal">NO</bool>
54+
</object>
4455
<object class="IBUIViewController" id="271014566">
4556
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics">
4657
<int key="IBUIStatusBarStyle">2</int>
@@ -96,6 +107,14 @@
96107
</object>
97108
<int key="connectionID">18</int>
98109
</object>
110+
<object class="IBConnectionRecord">
111+
<object class="IBCocoaTouchOutletConnection" key="connection">
112+
<string key="label">subViewController</string>
113+
<reference key="source" ref="664661524"/>
114+
<reference key="destination" ref="265684258"/>
115+
</object>
116+
<int key="connectionID">20</int>
117+
</object>
99118
</object>
100119
<object class="IBMutableOrderedSet" key="objectRecords">
101120
<object class="NSArray" key="orderedObjects">
@@ -133,6 +152,11 @@
133152
<reference key="object" ref="271014566"/>
134153
<reference key="parent" ref="0"/>
135154
</object>
155+
<object class="IBObjectRecord">
156+
<int key="objectID">19</int>
157+
<reference key="object" ref="265684258"/>
158+
<reference key="parent" ref="0"/>
159+
</object>
136160
</object>
137161
</object>
138162
<object class="NSMutableDictionary" key="flattenedProperties">
@@ -146,6 +170,8 @@
146170
<string>12.IBPluginDependency</string>
147171
<string>17.CustomClassName</string>
148172
<string>17.IBPluginDependency</string>
173+
<string>19.CustomClassName</string>
174+
<string>19.IBPluginDependency</string>
149175
<string>3.CustomClassName</string>
150176
<string>3.IBPluginDependency</string>
151177
</object>
@@ -161,6 +187,8 @@
161187
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
162188
<string>CameraViewController</string>
163189
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
190+
<string>cvViewController</string>
191+
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
164192
<string>cvAppDelegate</string>
165193
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
166194
</object>
@@ -177,7 +205,7 @@
177205
<reference key="dict.values" ref="0"/>
178206
</object>
179207
<nil key="sourceID"/>
180-
<int key="maxID">18</int>
208+
<int key="maxID">20</int>
181209
</object>
182210
<object class="IBClassDescriber" key="IBDocument.Classes">
183211
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -197,24 +225,31 @@
197225
<bool key="EncodedWithXMLCoder">YES</bool>
198226
<object class="NSArray" key="dict.sortedKeys">
199227
<bool key="EncodedWithXMLCoder">YES</bool>
228+
<string>subViewController</string>
200229
<string>viewController</string>
201230
<string>window</string>
202231
</object>
203232
<object class="NSMutableArray" key="dict.values">
204233
<bool key="EncodedWithXMLCoder">YES</bool>
205234
<string>UIViewController</string>
235+
<string>UIViewController</string>
206236
<string>UIWindow</string>
207237
</object>
208238
</object>
209239
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
210240
<bool key="EncodedWithXMLCoder">YES</bool>
211241
<object class="NSArray" key="dict.sortedKeys">
212242
<bool key="EncodedWithXMLCoder">YES</bool>
243+
<string>subViewController</string>
213244
<string>viewController</string>
214245
<string>window</string>
215246
</object>
216247
<object class="NSMutableArray" key="dict.values">
217248
<bool key="EncodedWithXMLCoder">YES</bool>
249+
<object class="IBToOneOutletInfo">
250+
<string key="name">subViewController</string>
251+
<string key="candidateClassName">UIViewController</string>
252+
</object>
218253
<object class="IBToOneOutletInfo">
219254
<string key="name">viewController</string>
220255
<string key="candidateClassName">UIViewController</string>
@@ -230,6 +265,14 @@
230265
<string key="minorKey">./Classes/cvAppDelegate.h</string>
231266
</object>
232267
</object>
268+
<object class="IBPartialClassDescription">
269+
<string key="className">cvViewController</string>
270+
<string key="superclassName">UIViewController</string>
271+
<object class="IBClassDescriptionSource" key="sourceIdentifier">
272+
<string key="majorKey">IBProjectSource</string>
273+
<string key="minorKey">./Classes/cvViewController.h</string>
274+
</object>
275+
</object>
233276
</object>
234277
</object>
235278
<int key="IBDocument.localizationMode">0</int>

cv/en.lproj/MainWindow.xib

+42-1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,15 @@
4141
<object class="IBUICustomObject" id="664661524">
4242
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
4343
</object>
44+
<object class="IBUIViewController" id="423285362">
45+
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
46+
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
47+
<int key="IBUIInterfaceOrientation">1</int>
48+
<int key="interfaceOrientation">1</int>
49+
</object>
50+
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
51+
<bool key="IBUIHorizontal">NO</bool>
52+
</object>
4453
<object class="IBUIViewController" id="1041856850">
4554
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
4655
<object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
@@ -95,6 +104,14 @@
95104
</object>
96105
<int key="connectionID">22</int>
97106
</object>
107+
<object class="IBConnectionRecord">
108+
<object class="IBCocoaTouchOutletConnection" key="connection">
109+
<string key="label">subViewController</string>
110+
<reference key="source" ref="664661524"/>
111+
<reference key="destination" ref="423285362"/>
112+
</object>
113+
<int key="connectionID">24</int>
114+
</object>
98115
</object>
99116
<object class="IBMutableOrderedSet" key="objectRecords">
100117
<object class="NSArray" key="orderedObjects">
@@ -131,6 +148,11 @@
131148
<reference key="object" ref="1041856850"/>
132149
<reference key="parent" ref="0"/>
133150
</object>
151+
<object class="IBObjectRecord">
152+
<int key="objectID">23</int>
153+
<reference key="object" ref="423285362"/>
154+
<reference key="parent" ref="0"/>
155+
</object>
134156
</object>
135157
</object>
136158
<object class="NSMutableDictionary" key="flattenedProperties">
@@ -145,6 +167,8 @@
145167
<string>16.IBPluginDependency</string>
146168
<string>18.CustomClassName</string>
147169
<string>18.IBPluginDependency</string>
170+
<string>23.CustomClassName</string>
171+
<string>23.IBPluginDependency</string>
148172
</object>
149173
<object class="NSMutableArray" key="dict.values">
150174
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -156,6 +180,8 @@
156180
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
157181
<string>CameraViewController</string>
158182
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
183+
<string>cvViewController</string>
184+
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
159185
</object>
160186
</object>
161187
<object class="NSMutableDictionary" key="unlocalizedProperties">
@@ -170,7 +196,7 @@
170196
<reference key="dict.values" ref="0"/>
171197
</object>
172198
<nil key="sourceID"/>
173-
<int key="maxID">22</int>
199+
<int key="maxID">24</int>
174200
</object>
175201
<object class="IBClassDescriber" key="IBDocument.Classes">
176202
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -190,24 +216,31 @@
190216
<bool key="EncodedWithXMLCoder">YES</bool>
191217
<object class="NSArray" key="dict.sortedKeys">
192218
<bool key="EncodedWithXMLCoder">YES</bool>
219+
<string>subViewController</string>
193220
<string>viewController</string>
194221
<string>window</string>
195222
</object>
196223
<object class="NSMutableArray" key="dict.values">
197224
<bool key="EncodedWithXMLCoder">YES</bool>
198225
<string>UIViewController</string>
226+
<string>UIViewController</string>
199227
<string>UIWindow</string>
200228
</object>
201229
</object>
202230
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
203231
<bool key="EncodedWithXMLCoder">YES</bool>
204232
<object class="NSArray" key="dict.sortedKeys">
205233
<bool key="EncodedWithXMLCoder">YES</bool>
234+
<string>subViewController</string>
206235
<string>viewController</string>
207236
<string>window</string>
208237
</object>
209238
<object class="NSMutableArray" key="dict.values">
210239
<bool key="EncodedWithXMLCoder">YES</bool>
240+
<object class="IBToOneOutletInfo">
241+
<string key="name">subViewController</string>
242+
<string key="candidateClassName">UIViewController</string>
243+
</object>
211244
<object class="IBToOneOutletInfo">
212245
<string key="name">viewController</string>
213246
<string key="candidateClassName">UIViewController</string>
@@ -223,6 +256,14 @@
223256
<string key="minorKey">./Classes/cvAppDelegate.h</string>
224257
</object>
225258
</object>
259+
<object class="IBPartialClassDescription">
260+
<string key="className">cvViewController</string>
261+
<string key="superclassName">UIViewController</string>
262+
<object class="IBClassDescriptionSource" key="sourceIdentifier">
263+
<string key="majorKey">IBProjectSource</string>
264+
<string key="minorKey">./Classes/cvViewController.h</string>
265+
</object>
266+
</object>
226267
</object>
227268
</object>
228269
<int key="IBDocument.localizationMode">0</int>

0 commit comments

Comments
 (0)