-
Notifications
You must be signed in to change notification settings - Fork 0
/
PlaceMarkViewController.m
119 lines (98 loc) · 4.05 KB
/
PlaceMarkViewController.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
//
// PlaceMarkViewController.m
// PlaceMark
//
// Created by Matthaus Litteken on 7/15/10.
// Copyright (c) 2010 Matthaus Litteken
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.//
//
// Created by Matthaus Litteken on 8/6/10.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
#import "PlaceMarkViewController.h"
@implementation PlaceMarkViewController
@synthesize pmName, pmDescription, pmLatitude, pmLongitude, pmThreshold, pmThresholdLabel, placeMark;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
// Initialization code
}
return self;
}
- (IBAction) updateName:(id)sender {
self.placeMark.pmName = self.pmName.text;
[self.placeMark updateName:self.pmName.text];
}
- (IBAction) updateDescription:(id)sender {
self.placeMark.description = self.pmDescription.text;
[self.placeMark updateDescription];
}
- (IBAction) updateLatitude:(id)sender {
self.placeMark.latitude = [[NSNumber alloc] initWithDouble: [self.pmLatitude.text doubleValue]];
[self.placeMark updateLat:[[NSNumber alloc] initWithDouble: [pmLatitude.text doubleValue]]];
[self.placeMark updateDistance];
}
- (IBAction) updateLongitude:(id)sender {
self.placeMark.longitude = [[NSNumber alloc] initWithDouble: [self.pmLongitude.text doubleValue]];
[self.placeMark updateLong:[[NSNumber alloc] initWithDouble:[pmLongitude.text doubleValue]]];
[self.placeMark updateDistance];
}
- (IBAction) updateThreshold:(id)sender {
self.placeMark.threshold = (NSInteger) self.pmThreshold.value;
[self.placeMark updateThreshold: (NSInteger) self.pmThreshold.value];
[self.pmThresholdLabel setText:[NSString stringWithFormat:@"%0.f", self.pmThreshold.value]];
}
/*
// The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
- (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 {
}
*/
/*
// 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 {
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
// Release any cached data, images, etc that aren't in use.
}
- (void)viewDidUnload {
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}
- (void)dealloc {
[super dealloc];
}
@end