Bronze Challenge


#1

I added one line for the bronze challenge (see below). I believe it worked, it only updated when I changed locations on the simulator.

[color=#FF4040] [locationManager setDistanceFilter:50];[/color]


-(id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        //Create location manager object
        locationManager = [[CLLocationManager alloc]init];
             
        //Set the locationManager Deligate
        [locationManager setDelegate:self];
        
        //Set the location manager to as accurate as possible  --may consume more time / power
        [locationManager setDesiredAccuracy:kCLLocationAccuracyBest];
        
        [locationManager setDistanceFilter:50];
        
        //Start looking for location
        [locationManager startUpdatingLocation];
    }
    return self;
}

#2

For fun I made a variable that can be used instead of hard coding the value and that seemed to work as well

WhereamiViewController.h

#import <UIKit/UIKit.h>
#import <CoreLocation/CoreLocation.h>

//add to proclaim that that the WhereamiViewController conforms to teh CLLocationManagerDelegate protocol.
@interface WhereamiViewController : UIViewController

{
CLLocationManager *locationManager;
}
[color=#FF4000]@property int refreshDistance;[/color]

@end

Procedure from WhereamiViewController.m

-(id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {

    //Set the refreshDistance for the distanceFilter.
   [color=#FF4000] [self setRefreshDistance:50];[/color]
    
    //Create location manager object
    locationManager = [[CLLocationManager alloc]init];
         
    //Set the locationManager Deligate
    [locationManager setDelegate:self];
    
    //Set the location manager to as accurate as possible  --may consume more time / power
    [locationManager setDesiredAccuracy:kCLLocationAccuracyBest];
    
    [locationManager setDistanceFilter:[color=#FF4000]refreshDistance[/color]];
    
    //Start looking for location
    [locationManager startUpdatingLocation];
}
return self;

}