First commit

This commit is contained in:
Norbert Schmidt
2017-09-04 11:40:05 +02:00
commit 025e53504d
113 changed files with 20931 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
//
// CoreLocationController.h
// CoreLocationDemo
//
// Created by Nicholas Vellios on 8/15/10.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>
@protocol CoreLocationControllerDelegate
@required
- (void)locationUpdate:(CLLocation *)location;
- (void)locationError:(NSError *)error;
@end
@interface CoreLocationController : NSObject <CLLocationManagerDelegate> {
CLLocationManager *locMgr;
id delegate;
}
@property (nonatomic, retain) CLLocationManager *locMgr;
@property (nonatomic, assign) id delegate;
@end

View File

@@ -0,0 +1,44 @@
//
// CoreLocationController.m
// CoreLocationDemo
//
// Created by Nicholas Vellios on 8/15/10.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
#import "CoreLocationController.h"
@implementation CoreLocationController
@synthesize locMgr, delegate;
- (id)init {
self = [super init];
if(self != nil) {
self.locMgr = [[[CLLocationManager alloc] init] autorelease];
self.locMgr.delegate = self;
}
return self;
}
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation {
if([self.delegate conformsToProtocol:@protocol(CoreLocationControllerDelegate)]) {
[self.delegate locationUpdate:newLocation];
}
}
- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error {
if([self.delegate conformsToProtocol:@protocol(CoreLocationControllerDelegate)]) {
[self.delegate locationError:error];
}
}
- (void)dealloc {
[self.locMgr release];
[super dealloc];
}
@end