Hi, I tried to follow the book as closely as posssible, and I’ve already linked all the worldView, textField and activityindicator together in the .xib file.
However, when I start to run the app, it crashes with either a “exc_bad_access” error, or it’ll throw a “unrecognized selector” exception.
I’ve been working on this for 4 hours now, but still don’t understand what’s wrong. Please help…
@synthesize window = _window;
@synthesize viewController = _viewController;
if ([locationManager delegate] == self)
(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
locationManager = [[CLLocationManager alloc] init];
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
// Override point for customization after application launch.
self.viewController = [[[ViewController alloc] initWithNibName:@“ViewController” bundle:nil] autorelease];
self.window.rootViewController = self.viewController;
(void)mapView:(MKMapView *)mapView didUpdateUserLocation:(MKUserLocation *)userLocation
CLLocationCoordinate2D loc = [userLocation coordinate];
MKCoordinateRegion region = MKCoordinateRegionMakeWithDistance(loc, 250, 250);
[worldView setRegion:region animated:YES];
My IBOutlets are declared as:
IBOutlet MKMapView* worldView;
IBOutlet UITextField* locationField;
IBOutlet UIActivityIndicatorView* rotater;
the NSLog is not showing the “zooming yet” part, which means that the program hasn’t even reached that part yet.