small medium large xlarge

15 Dec 2009, 05:52
Paul Bencal (2 posts)

Hi Tim, Fantastic book … well paced with great projects. I am having a slight problem though. Whenever I try to compile any of the solution files you’ve provided I receive this error:

“Line Location Tool:0: error: There is no SDK with the name or path ‘macosx10.6’.

I assume this is because I have not upgraded to Snow Leopard. My current OS is 10.5.7 running Xcode version 3.1.3. Can I make any simple changes that will resolve this error so that your 3.2 Xcode project files will run with my 3.1.3 Xcode install? I am in a large network environment that won’t be upgrading our OS any time soon so I don’t have the option of simply bringing my machine up to the current releases. Thanks, Paul

15 Dec 2009, 10:29
Tim Isted (105 posts)

Hi Paul, I think it would be a good idea for me to upload separate sample code for earlier Xcode versions, as there will be a number of differences that will cause multiple warnings, and some errors to be corrected.

For now, the following instructions might help:

With a project open in Xcode, choose Project > Set Active SDK > Mac OS X 10.5, as shown here:

This will get rid of the warning above, as you are now building the project under the 10.5 Leopard SDK (Software Development Kit) rather than 10.6 Snow Leopard SDK which you won’t yet have.

But, when you Build the project, you’ll likely receive a number of new warnings, and possibly some errors, as shown here:

To correct errors about not being to find a protocol declaration, you’ll need to remove that protocol declaration from the offending interface file. In the example shown in the image, change this:

@interface TextAppAppDelegate : NSObject <NSApplicationDelegate> {

to this:

@interface TextAppAppDelegate : NSObject {

If there are multiple protocols listed, but only one is described in an error message: @interface SomeObject : NSObject <goodProtocol, badProtocol> {

Remove just the incorrect protocol along with any extra comma, like this:

@interface SomeObject : NSObject <goodProtocol> {

You may also run into some methods that aren’t available under 10.5, such as a Table View Data Source method used in Chapter 13: reloadDataForRowIndexes:columnIndexes:

The application will still work, but you’ll experience some strange behavior when you try to mark an item as purchased, and see messages logged to the Xcode console about unrecognized selectors.

When I add sample code for earlier Xcode versions, I’ll make any necessary code changes, and surround the changed code with comments explaining what’s going on!

Hope this helps you out for the short-term, Tim

15 Dec 2009, 14:43
Paul Bencal (2 posts)

Thanks Tim. These fixes worked perfectly. Paul

You must be logged in to comment