Strange mistake in Apple Core Data tutorial

I did the Apple Core Data Tutorial , and for the first time I was offered to build a project, I got this error:

Ld /Users/user/Library/Developer/Xcode/DerivedData/Locations-fajvunxiruohofbhzimrgekrpnqh/Build/Products/Debug-iphonesimulator/Locations.app/Locations normal i386 cd "/Users/user/Documents/xcode projects/Locations" setenv MACOSX_DEPLOYMENT_TARGET 10.6 setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-gcc-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk -L/Users/user/Library/Developer/Xcode/DerivedData/Locations-fajvunxiruohofbhzimrgekrpnqh/Build/Products/Debug-iphonesimulator -F/Users/user/Library/Developer/Xcode/DerivedData/Locations-fajvunxiruohofbhzimrgekrpnqh/Build/Products/Debug-iphonesimulator -filelist /Users/user/Library/Developer/Xcode/DerivedData/Locations-fajvunxiruohofbhzimrgekrpnqh/Build/Intermediates/Locations.build/Debug-iphonesimulator/Locations.build/Objects-normal/i386/Locations.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -framework UIKit -framework Foundation -framework CoreGraphics -framework CoreData -o /Users/user/Library/Developer/Xcode/DerivedData/Locations-fajvunxiruohofbhzimrgekrpnqh/Build/Products/Debug-iphonesimulator/Locations.app/Locations Undefined symbols for architecture i386: "_OBJC_CLASS_$_CLLocationManager", referenced from: objc-class-ref in RootViewController.o "_kCLLocationAccuracyNearestTenMeters", referenced from: -[RootViewController locationManager] in RootViewController.o ld: symbol(s) not found for architecture i386 collect2: ld returned 1 exit status 

I am using Xcode 4.0.2, Mac OS X 10.6.8. What could be the reason for this? I followed the tutorial step by step and have absolutely no idea what could go wrong.

+4
source share
4 answers

You need to import the CoreLocation environment. This can be done by going to Project - Build Phases - Link Binary with Libraries

+9
source

It looks like you need to add a CoreLocation structure to the related framework of the project.

In the project settings, select the target application program and in the "Assembling phases" section add it to the "Link binary files to libraries" step.

+3
source

When you started the project, did you select "Use master data for storage"? I think it adds the structure you need.

click on your project in the navigation bar (apple + 1)

goals → your project phases → builds → binary link files with libraries → +

then select CoreData.framework and add.

+1
source

Sometimes the .m file is removed from the Compiled Sources list in Xcode. You need to add the .m file manually:

Assembly phases> Compiled sources> (check if your .m file is really missing)> Add .m file> Assembly

0
source

All Articles