この UI をアプリの地図の上に追加して、ドライバーが運転している現在の速度を表示したいと考えています。これらのエラーは main.m に表示されます。なぜ、どうすれば修正できますか?
宣言されていない識別子 'viewSpeed' の使用
インスタンス メソッド '-setViewSpeed:' が見つかりません (戻り型のデフォルトは 'id')
locationmanager.m
予期される ':'
予期されるメソッド本体
予期される識別子または '(
'
#import "locationManager.h"
@implementation locationManager
@synthesize locationManager;
@synthesize fastView;
- (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);
{
self.currentLocation = newLocation;
BOOL newLocationIsValid = [self isValidLocation:newLocation witholdLocation:oldLocation];
if(newLocationIsValid && oldLocation)
{
int distance = [newLocation distanceFromLocation:oldLocation];
if(distance >2 && distance<10)
{
[self.fastView setText:[NSString stringWithFormat:@"%i meters ", distance]];
}
- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)errort
{
NSLog(@"Error: %@", [error description]);
}
@end
- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations {
NSLog (@"%s", __func__);
}
main.m
-(void)userDidLoagin
{
[self dismissViewControllerAnimated:YES completion:nil];
}
- (void)dealloc
{
[userMap release];
[_Speed release];
[viewSpeed release];
[_fastView release];
[super dealloc];
}
- (void)viewDidUnload
{
[userMap release];
userMap = nil;
[self setSpeed:nil];
[self setViewSpeed:nil];
[self setFastView:nil];
[super viewDidUnload];
}