I have rewritten the Homepwner app to a flowerCollectorApp.
I want the app to record a CLLocation together with the date when a new Item is registered, and have added a CLLocation*myLocation to the instancevariables of BNRItem.
I have managed to make the BNRItem find a location when a new item is added, but I can’t figure how to set the BNRItem.myLocation to register the findings of locationManager.
Anyone out there feeling giving a newbe some hints? It will be very appriciated.
BNRItem.h @property (nonatomic, retain,strong) CLLocation *myLocation; @property (nonatomic, retain, strong)CLLocationManager *locationManager;
// Call the superclass’s designated initializer
self = [super init];
// Did the superclass’s designated initializer succeed?
// Give the instance variables initial values
dateCreated = [[NSDate alloc] init];
locationManager = [[CLLocationManager alloc] init]; [locationManager setDelegate:self]; locationManager.desiredAccuracy = kCLLocationAccuracyBest; locationManager.distanceFilter = 50.0f; [locationManager startUpdatingLocation]; myLoction= [[CLLocation alloc] init];[/b]
} //somehow set myLocation = newLocation :-S
// Return the address of the newly initialized object
(void) locationManager: (CLLocationManager *) manager
didUpdateToLocation: (CLLocation *) newLocation
fromLocation: (CLLocation *) oldLocation
- (void) locationManager: (CLLocationManager *) manager
didFailWithError: (NSError *) error
NSLog(@“Error obtaining location %@”,error);