Application Not Showing Geographic Info


#1

I’m having trouble getting the application to work correctly. I am using XCode 5 with iOS 7 and I’m wondering if that might be the problem. The application builds successfully without errors but in the console output I get:

2013-10-04 13:59:33.565 Whereami[7320:a0b] Cannot find executable for CFBundle 0x1094a1de0 </Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/System/Library/AccessibilityBundles/GeoServices.axbundle> (not loaded) 2013-10-04 13:59:33.579 Whereami[7320:a0b] Cannot find executable for CFBundle 0x10a42fff0 </Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/System/Library/AccessibilityBundles/CertUIFramework.axbundle> (not loaded)

Here is my code. I’ve altered the interface to conform to the CLLocationManagerDelegate protocol to get rid of the warning message mentioned in the book but even if I leave that code out it doesn’t work.

WhereamiViewController.h

[code]#import <UIKit/UIKit.h>
#import <CoreLocation/CoreLocation.h>

@interface WhereamiViewController : UIViewController
{
CLLocationManager *locationManager;
}

@end[/code]

WhereamiViewController.m

[code]#import “WhereamiViewController.h”

@implementation WhereamiViewController

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

    if(self) {
    locationManager = [[CLLocationManager alloc] init];
    [locationManager setDelegate:self];
    [locationManager setDesiredAccuracy:kCLLocationAccuracyBest];
    [locationManager startUpdatingLocation];
    }

    return self;
    }

// Using the current method as the one in the book is deprecated in iOS 6

  • (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations
    {
    NSLog(@“LOCATION: %@”, [locations lastObject]);
    }

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

@end[/code]

Can anyone see what might be the problem?

Thanks,
-Michael


#2

I downloaded JetBrains AppCode and ran the project in that IDE. It shows four errors in the build messages. I’m a novice at Objective-C and iOS programming but could this be a compiler bug in XCode 5? Doesn’t look promising.

Details: Failed to register "/System/Library/CoreServices/CoreTypes.bundle/Contents/Library/MobileDevices.bundle" with Launch Services, error code: -10811. Function: __RegisterUTIsIfNeeded_block_invoke Thread: <NSThread: 0x7fe6a9c0e5d0>{name = (null), num = 1} Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.


#3

[quote]I downloaded JetBrains AppCode and ran the project in that IDE. It shows four errors in the build messages. I’m a novice at Objective-C and iOS programming but could this be a compiler bug in XCode 5? Doesn’t look promising.
[/quote]
Of course, it doesn’t. As a novice you are getting a bit intrepid here: start with the version of the Xcode and iOS for which the book was written.


#4

I guess I wasn’t realizing the obvious - that I could use an older version of XCode. I just downloaded what was available on the App Store and assumed that’s all that was available now. Going to download an older XCode now. Thanks.


#5

UPDATE: OK, I went to the Apple Developer website and was able to download XCode 4.6.2 and load an iOS 6 simulator. The code works as described in the book. I now understand some the iOS developer tweets I saw concerned about having to re-write their applications for iOS 7. It appears that Apple has radically changed the way that applications for iOS 7 are developed. Looks like I’m going to have to invest in the 4th edition of this book when it comes out in December. :slight_smile: