forked from wikimedia/wikipedia-iphone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CLController.m
47 lines (36 loc) · 881 Bytes
/
CLController.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
//
// CLController.m
// Wikipedia Mobile
//
// Created by Andreas Lengyel on 2/16/10.
// Copyright 2010 Apple Inc. All rights reserved.
//
#import "CLController.h"
#pragma mark CLLocationController
@implementation CLController
@synthesize locationManager;
@synthesize delegate;
- (id) init {
self = [super init];
if (self != nil) {
self.locationManager = [[[CLLocationManager alloc] init] autorelease];
self.locationManager.delegate = self;
}
return self;
}
- (void)locationManager:(CLLocationManager *)manager
didUpdateToLocation:(CLLocation *)newLocation
fromLocation:(CLLocation *)oldLocation
{
[self.delegate locationUpdate:newLocation];
}
- (void)locationManager:(CLLocationManager *)manager
didFailWithError:(NSError *)error
{
[self.delegate locationError:error];
}
- (void)dealloc {
[locationManager release];
[super dealloc];
}
@end