-
Notifications
You must be signed in to change notification settings - Fork 1
/
MyCLController.m
43 lines (34 loc) · 939 Bytes
/
MyCLController.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
//
// MyCLController.m
// Oraviaggiando
//
// Created by Francesco Piero Paolicelli on 03/07/12.
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//
#import "MyCLController.h"
@implementation MyCLController
@synthesize locationManager;
- (id) init {
self = [super init];
if (self != nil) {
self.locationManager = [[[CLLocationManager alloc] init] autorelease];
self.locationManager.delegate = self; // send loc updates to myself
}
return self;
}
- (void)locationManager:(CLLocationManager *)manager
didUpdateToLocation:(CLLocation *)newLocation
fromLocation:(CLLocation *)oldLocation
{
NSLog(@"Location: %@", [newLocation description]);
}
- (void)locationManager:(CLLocationManager *)manager
didFailWithError:(NSError *)error
{
NSLog(@"Error: %@", [error description]);
}
- (void)dealloc {
[self.locationManager release];
[super dealloc];
}
@end