Has Anyone completed the Whereami app with Xcode 4 and iOS 5


#1

I get this error when trying to run it.

You can download my project from link below.

Whereami source xcode 4.3 iOS5 project code download

This GDB was configured as "--host=i386-apple-darwin --target=arm-apple-darwin".tty /dev/ttys001
sharedlibrary apply-load-rules all
target remote-mobile /tmp/.XcodeGDBRemote-9888-51
Switching to remote-macosx protocol
mem 0x1000 0x3fffffff cache
mem 0x40000000 0xffffffff none
mem 0x00000000 0x0fff none
[Switching to process 8195 thread 0x0]
[Switching to process 8195 thread 0x0]
2011-06-20 23:57:10.702 Whereami[1566:707] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIApplication 0x23e6d0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key view.'
*** First throw call stack:
(0x31e31d2f 0x31ac40e3 0x31e31b31 0x3679dc83 0x3674e473 0x3674dcbd 0x3673c7b5 0x338959b7 0x31dabfa5 0x31da58c3 0x3389497b 0x33895f95 0x337c7baf 0x3368961d 0x33679977 0x336789eb 0x336784e7 0x33677e5d 0x378840bb 0x31dfc131 0x31dfe3bf 0x31dfea55 0x31d9cc43 0x31d9cb05 0x33676109 0x336732a5 0x2ea5 0x2e58)
terminate called throwing an exceptionkill
quit

#2

I am also having a problem trying to complete this exercise - I have pretty much copied it word for work and I am getting errors. :frowning: Is it worth going through this book with Xcode 4.2.1 or am I going to have to wait for March for the new book?

#import “QuizAppDelegate.h”

@implementation QuizAppDelegate

@synthesize window = _window;

  • (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
    //create location manager object
    locationManager = [[CLLocationManager alloc]init];
    //make this instance of quizappdelegate the delegate
    // it will send its messages to our quizappdelegate/whereamiAppdelegate
    [locationManager setDelegate:self];
    //we want all results from the location manager
    [locationManager setDistanceFilter:kCLDistanceFilterNone];
    //and 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 it location immediately
    [locationManager startUpdatingLocation];

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

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

    • (void)dealloc
      {
      if ([locationManager delegate] == self)
      [locationManager setDelegate:nil];

      [locationManager release];
      [_window release];
      [super dealloc];
      }


#3

@Amidabrian

You want to put all of that code inside of the ViewController, not the AppDelegate. And then make sure you make the connections in the xib file to point to the ViewController file.