Zooms on hack position, but no text field no activity


#1

I checked my code and seems to be OK. Also re set the XIB links, think they are correct. When I run in simulator I do get a zoomed map, blue dot on apple location, but nothing else. No text entry box, no activity indicator.

I also have NSLog statements in a number of positions in the .m file, but the only one that hits is MapView delegate didUpdateLocation.

[code]
#import “whereamiAppDelegate.h”

@implementation CLLocationManager (TemporaryHack)

  • (void)hackLocationFix
    {
    NSLog(@“in hackLocationFix”);
    CLLocation *location = [[CLLocation alloc] initWithLatitude:33.758616 longitude:-84.363863];
    [[self delegate] locationManager:self didUpdateToLocation:location fromLocation:nil];
    }

  • (void)startUpdatingLocation
    {
    NSLog(@“in startUpdatingLocation”);
    [self performSelector:@selector(hackLocationFix) withObject:nil afterDelay:0.1];
    }

@end

@implementation whereamiAppDelegate

@synthesize window = _window;

  • (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
    NSLog(@“in application”);

    //create location manager object
    locationManager = [[CLLocationManager alloc] init];

    //set delegate property of the location manager… will be a warning from this line of coe, ignore it for now
    [locationManager setDelegate:self];

    //we want all resluts from the location manager
    [locationManager setDistanceFilter:kCLDistanceFilterNone];

    //we want it to be as accurate as possible, regardless of how much time/power it takes
    [locationManager setDesiredAccuracy:kCLLocationAccuracyBest];

    //tell our manager to start looking for its locaton immediately
    // [locationManager startUpdatingLocation];
    [worldView setShowsUserLocation:YES];

    // Override point for customization after application launch.
    [self.window makeKeyAndVisible];

    return YES;
    }

// Need to add this after iOS 4.2 or else zooming doesn’t work

  • (void)mapView:(MKMapView *)mv didUpdateUserLocation:(MKUserLocation *)u
    {
    NSLog(@“in mapView delegate didUpdateUserLocation”);
    CLLocationCoordinate2D loc = [u coordinate];
    MKCoordinateRegion region = MKCoordinateRegionMakeWithDistance(loc, 250, 250); [worldView setRegion:region animated:YES];
    }

  • (void) locationManager:(CLLocationManager *)manager didUpdateHeading:(CLHeading *)newHeading
    {
    NSLog(@"%@", newHeading);
    }

//implement delegate method to start receiving CLLocation instances from the CLLocationManager

  • (void)locationManager:(CLLocationManager *)manager
    didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
    {
    NSLog(@"%@", newLocation);
    }

// Need to know if CLLocationManager fails to find a location and why

  • (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error
    {
    NSLog(@“Could not find location: %@”, error);
    }

  • (void)applicationWillResignActive:(UIApplication )application
    {
    /

    Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
    Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
    */
    }

  • (void)applicationDidEnterBackground:(UIApplication )application
    {
    /

    Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
    If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
    */
    }

  • (void)applicationWillEnterForeground:(UIApplication )application
    {
    /

    Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
    */
    }

  • (void)applicationDidBecomeActive:(UIApplication )application
    {
    /

    Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
    */
    }

  • (void)applicationWillTerminate:(UIApplication )application
    {
    /

    Called when the application is about to terminate.
    Save data if appropriate.
    See also applicationDidEnterBackground:.
    */
    }

  • (void)dealloc
    {
    [_window release];
    [super dealloc];
    }

@end

[code]