views:

194

answers:

2

Hi Pulling my hair out in trying to get a simple window based project to compile.

I am running both 3.2.2 and 3.2.3 versions of Xcode. The latter is set up in a separate folder.

Originally I used the latter to create and compile my project against the new 4.0 sdk. It compiled fine. Then I made the mistake of deleting some sdks I thought I no longer needed.

Ever since I can no longer compile.

Right now I get a dozen or so errors similar to the following "_OBJC_CLASS_$_CATransition", referenced from: objc-class-ref-to-CATransition in ViewTransitionsAppDelegate.o

My active executable is the iphone simulator 4 and Base SDK is iPhone device 3.0.

I tried reinstalling the xcode3.2.3 installer, no difference.

I'm totally stymied, as my project WAS working and compiling fine, both to the simulator and external device.

Are there any best practices or recommended steps in fixing or rebuilding a project when it won't compile?

Any help welcome!

A: 

CATransition is probably not available in the older version of the OS (pre-4.0). You basically have 3 choices:

1) Rewrite the portions dealing with CATransition to not use it (or anything else not available to pre-4.0 iOS versions)

2) Write code that, either at compilation time or runtime, chooses the correct behavior to either use CATransitions or disable the feature, or to implement it differently (see Apple's iPad development guide -- it shows a very useful technique involving NSClassFromString)

3) Target the later OS

You'll probably want to go with #3

Jared P
CATransition has been available since iPhone OS 2.0, thats not the issue
macatomy
Setting my basesdk to 3.13 and higher seemed to resolve the issue.(Although always see the iPad simulator with 3.13)One more issue to resolve, although it now compiles and launches without error, I'm not seeing anything after launching, just a black screen. In my MainWindow.xib I simply have a UIImage view and UIToolbar...everything seems connected properly in IB
eco_bach
+1  A: 

Make sure that your application is linked against QuartzCore.framework and that you're importing the CoreAnimation headers wherever you use CATransition:

#import <QuartzCore/CoreAnimation.h>

Otherwise, I'd recommend completely deleting all installations of Xcode/Dev Tools from your system (do a thorough clean) and reinstall the latest SDK.

EDIT: Also forgot to mention that the latest iPhone SDK (iOS 4), at least for me, does not include previous versions of the iPhone SDK. It only includes the 3.2 and 4.0 SDKs, so you will have to edit the target/project settings of your app to use iPhone SDK 4.0.

macatomy