MyCLController.m
FirstViewController.m
-
so how to bring those values here and print them???
Code:
@synthesize locationManager, delegate, myCLController;
- (id) init
{
self = [super init];
if (self != nil) {
self.locationManager = [[[CLLocationManager alloc] init] autorelease];
self.locationManager.delegate = self; //send location updates to myself
}
return self;
}
-(void)locationManager : (CLLocationManager *) manager
didUpdateToLocation: (CLLocation *) newLocation fromLocation:
(CLLocation *) oldLocation
{
lon = newLocation.coordinate.longitude;
lat = newLocation.coordinate.latitude;
NSLog(@"CLCOntroller X: %f", -lon);
NSLog(@"CLController Y: %f", lat);
Y4 = (( (1.909271 + lon )*670) / (1.909271-1.890306));
X4 = (((52.486908 - lat)*588) / (52.486908-52.477086));
NSLog(@"x4: %f, y4: %f",X4, Y4 );
[B]//Can i use this X4 and Y4 in my first View controller?[/B]
[self.delegate locationUpdate:newLocation];
}
FirstViewController.m
-
Code:
(IBAction) Loc: (id) sender{
[B]how can print X4 and Y4 here[/B]
[B]NSLog(@"lat: %f ", X4 );
NSLog(@"lon: %f", Y4);[/B]
//which is printing 0.00000
}
so how to bring those values here and print them???