Skip to content

Commit

Permalink
Initial commit of ios-auto
Browse files Browse the repository at this point in the history
  • Loading branch information
penguinho committed Aug 2, 2012
0 parents commit 3ab56d3
Show file tree
Hide file tree
Showing 50 changed files with 3,891 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,4 @@

main/Utility/Properties/Resources.resources

main/Testing/Properties/.DS_Store
13 changes: 13 additions & 0 deletions LICENSE.txt
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,13 @@
Copyright [2012] [Dan Cuellar]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
18 changes: 18 additions & 0 deletions TestApp/Test App 2/MyViewControllerViewController.h
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,18 @@
//
// MyViewControllerViewController.h
// Test App 2
//
// Created by Joseph Cuellar on 8/1/12.
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface MyViewControllerViewController : UIViewController
@property (retain, nonatomic) IBOutlet UITextField *firstArg;
@property (retain, nonatomic) IBOutlet UITextField *secondArg;
@property (retain, nonatomic) IBOutlet UILabel *answerLabel;

- (IBAction)computeAction:(id)sender;

@end
67 changes: 67 additions & 0 deletions TestApp/Test App 2/MyViewControllerViewController.m
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,67 @@
//
// MyViewControllerViewController.m
// Test App 2
//
// Created by Joseph Cuellar on 8/1/12.
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "MyViewControllerViewController.h"

@interface MyViewControllerViewController ()

@end

@implementation MyViewControllerViewController
@synthesize answerLabel;
@synthesize firstArg;
@synthesize secondArg;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
[firstArg setAccessibilityLabel:@"IntegerA"];
[secondArg setAccessibilityLabel:@"IntegerB"];
[answerLabel setAccessibilityLabel:@"Compute Sum"];

return self;
}

- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
}

- (void)viewDidUnload
{
[self setFirstArg:nil];
[self setSecondArg:nil];
[self setAnswerLabel:nil];
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

- (void)dealloc {
[firstArg release];
[secondArg release];
[answerLabel release];
[super dealloc];
}
- (IBAction)computeAction:(id)sender {
int a = [[firstArg text] intValue];
int b = [[secondArg text] intValue];
int sum = a + b;
NSString *newLabelValue = [NSString stringWithFormat:@"%d",sum];
[answerLabel setText:newLabelValue];
}
@end
Loading

0 comments on commit 3ab56d3

Please sign in to comment.