views:

38

answers:

2

I have added the frameworks (MapKit and CoreLocation) by selecting the Frameworks folder, right clicking, Add > Existing Frameworks.

The app builds in the Simulator (3.1.3) but fails on the Device (3.1.3) with the error:

ld: warning: in /Development/Sites/iPhone Projects/SwitchViews/MapKit.framework/MapKit, file is not of required architecture Undefined symbols:
"_OBJC_CLASS_$_MKPinAnnotationView", referenced from: __objc_classrefs__DATA@0 in NextView.o ld: symbol(s) not found collect2: ld returned 1 exit status

A: 

It looks like you by accident have selected the "copy to project" checkbox when adding the framework.

Try to delete the framework from your project and add it again, making sure you have selected the default framework path, and that you don't copy it to your project.

Claus Broch
Where is this option Claus? I can't see it. I know the feature when you adding, say, an Image - but this is a different way.
daidai
Hmmm... you are probably right - this only applies to non-frameworks you add. However the "ld: warning..." indicates that it is trying to link against a local framework and not one in the SDK
Claus Broch
the Path is System/Library/Frameworks/MapKit.framework the Full Path is /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.3.sdk/System/Library/Frameworks/MapKit.framework the path type is Relative to Current SDKis there anything wrong with that?
daidai
That sounds like the correct path. But that's not the path that's used (and reported) by the linker as you originally wrote in the question
Claus Broch
Ah! Hmmmm..So how do I tell it to use the right one?
daidai
A: 

It seems that I just needed to restart Xcode to get things linked up properly.

daidai