// // CameraController.m // ZebraScan // // Created by Simon Urbanek on 2/20/09. // Copyright 2009 __MyCompanyName__. All rights reserved. // #import "ZSCameraController.h" @implementation ZSCameraController /* // The designated initializer. Override to perform setup that is required before the view is loaded. - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) { // Custom initialization } return self; } */ /* // Implement loadView to create a view hierarchy programmatically, without using a nib. - (void)loadView { } */ -(NSString *)stringPad:(int)numPad { NSMutableString *pad = [NSMutableString stringWithCapacity:1024]; for (int i=0; i -------------------"); } NSString *pad = [self stringPad:depth]; // print some information about the current view // NSLog([NSString stringWithFormat:@"%@.description: %@",pad,[theView description]]); if ([theView isKindOfClass:[UIImageView class]]) { NSLog([NSString stringWithFormat:@"%@.class: UIImageView",pad]); } else if ([theView isKindOfClass:[UILabel class]]) { NSLog([NSString stringWithFormat:@"%@.class: UILabel",pad]); NSLog([NSString stringWithFormat:@"%@.text: ",pad,[(UILabel *)theView text]]); } else if ([theView isKindOfClass:[UIButton class]]) { NSLog([NSString stringWithFormat:@"%@.class: UIButton",pad]); NSLog([NSString stringWithFormat:@"%@.title: ",pad,[(UIButton *)theView titleForState:UIControlStateNormal]]); } NSLog([NSString stringWithFormat:@"%@.frame: %.0f, %.0f, %.0f, %.0f", pad, theView.frame.origin.x, theView.frame.origin.x, theView.frame.size.width, theView.frame.size.height]); NSLog([NSString stringWithFormat:@"%@.subviews: %d",pad, [theView.subviews count]]); NSLog(@" "); // gotta love recursion: call this method for all subviews // for (int i=0; i<[theView.subviews count]; i++) { NSString *subPath = [NSString stringWithFormat:@"%@/%d",path,i]; NSLog([NSString stringWithFormat:@"%@--subview-- %@",pad,subPath]); [self inspectView:[theView.subviews objectAtIndex:i] depth:depth+1 path:subPath]; } if (depth==0) { NSLog(@"-------------------- -------------------"); } } - (void) viewDidAppear: (BOOL)animated { [super viewDidAppear:animated]; UIView *v = self.view; // normally: layoutContainer -> transition -> view -> PLVameraView NSLog(@"%@; view = %@", self, self.view); if (v && [[v subviews] count] > 0) { // we always have the transition view, but just to make sure v = [[v subviews] objectAtIndex:0]; if (v && [[v subviews] count] > 0) { // the next one is the root view and we have that only when all is setup v = [[v subviews] objectAtIndex:0]; [self inspectView:v depth:0 path:@""]; if (v && [[v subviews] count] > 0) { // cameraView cameraView = v = [[v subviews] objectAtIndex:0]; #if 0 if ([[cameraView subviews] count] > 3) { // index 3 is the overlay v = [[v subviews] objectAtIndex:3]; [v setHidden:YES]; } #endif // [cameraView cameraShutterClicked: self]; } } } #if 0 UIView *plCameraView = [[[[[[self.view subviews] objectAtIndex:0] subviews] objectAtIndex:0] subviews] objectAtIndex:0]; [[[plCameraView subviews] objectAtIndex:3] setHidden:YES]; #endif } /* // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. - (void)viewDidLoad { [super viewDidLoad]; } */ /* // Override to allow orientations other than the default portrait orientation. - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations return (interfaceOrientation == UIInterfaceOrientationPortrait); } */ - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview // Release anything that's not essential, such as cached data } - (void)dealloc { [super dealloc]; } @end