xcode "_OBJC_CLASS_$_Name", referenced in .... error, 4 days and cant figure out
I am new to programming, but have worked very hard to try and figure out why I am getting the above error. I have read and tried everything I have found online, the program is from Head First iPhone Development book Chapter 7 (their forum does not address this error and few questions on that forum every get answered).
I have tried and or confirmed:
Target is checked in the app target (by this I mean the m开发者_JAVA技巧ain app name is the only one that shows and it is checked as target)
I have tried changing versions of the simulator and sdk
I have added #import of the class it is looking for (my code is EXACTLY as the books)
My gut is telling me it is something in the IB, but no posts suggest that could be the problem (maybe something wired wrong?)
Any help would be greatly appreciated!!
update:
the CoreData framework is there - not missing that. Thank you though, any other thoughts?
Sorry for posting in "answers", only option available (wrote and posted question prior to creating an account - sorry for being a laaaamo)
Here is the full error:
Ld build/Debug-iphonesimulator/iBountyHunter.app/iBountyHunter normal i386
cd /Users/Home/Desktop/iBountyHunter
setenv MACOSX_DEPLOYMENT_TARGET 10.5
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/gcc-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk -L/Users/Home/Desktop/iBountyHunter/build/Debug-iphonesimulator -F/Users/Home/Desktop/iBountyHunter/build/Debug-iphonesimulator -filelist /Users/Home/Desktop/iBountyHunter/build/iBountyHunter.build/Debug-iphonesimulator/iBountyHunter.build/Objects-normal/i386/iBountyHunter.LinkFileList -mmacosx-version-min=10.5 -Xlinker -objc_abi_version -Xlinker 2 -framework Foundation -framework UIKit -framework CoreGraphics -framework CoreData -o /Users/Home/Desktop/iBountyHunter/build/Debug-iphonesimulator/iBountyHunter.app/iBountyHunter
Undefined symbols:
"_OBJC_CLASS_$_FugitiveDetailViewController", referenced from:
objc-class-ref-to-FugitiveDetailViewController in FugitiveListViewController.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
Thoughts? And thank you so much for the help!
I had this error when I accidentally had #import file.m
instead of .h
It sounds like, for whatever reason, your FugitiveDetailViewController.m file isn't added to the target. Select the file in Xcode, Get Info, and ensure that the checkbox next to your target is checked.
try this
- Remove the reference for the files from xcode
- Right click in project explorer (in xcode)
Add New Files..
- Select the files again and hit enter.
It seems in the newer xcodes if you drag the files they (.m
) sometimes do not get added in the Compile Source
under Build Phases
.
You are missing the CoreData.framekwork.
精彩评论