iphone - 链接器中的 Xcode 错误

标签 iphone xcode

我是新的 iPhone 开发者。我收到这个错误。

Ld /Users/c4ntechnology/Library/Developer/Xcode/DerivedData/iPatientCare-azwpvvrjjoaoygfcfqiicwkyssya/Build/Products/Debug-iphonesimulator/iPatientCare.app/iPatientCare normal i386 cd /Users/c4ntechnology/Desktop/iPatientCare setenv MACOSX_DEPLOYMENT_TARGET 10.6 setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk -L/Users/c4ntechnology/Library/Developer/Xcode/DerivedData/iPatientCare-azwpvvrjjoaoygfcfqiicwkyssya/Build/Products/Debug-iphonesimulator -F/Users/c4ntechnology/Library/Developer/Xcode/DerivedData/iPatientCare-azwpvvrjjoaoygfcfqiicwkyssya/Build/Products/Debug-iphonesimulator -filelist /Users/c4ntechnology/Library/Developer/Xcode/DerivedData/iPatientCare-azwpvvrjjoaoygfcfqiicwkyssya/Build/Intermediates/iPatientCare.build/Debug-iphonesimulator/iPatientCare.build/Objects-normal/i386/iPatientCare.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=50100 -lsqlite3 -framework UIKit -framework AVFoundation -framework CoreGraphics -o /Users/c4ntechnology/Library/Developer/Xcode/DerivedData/iPatientCare-azwpvvrjjoaoygfcfqiicwkyssya/Build/Products/Debug-iphonesimulator/iPatientCare.app/iPatientCare

Undefined symbols for architecture i386:
"_OBJC_CLASS_$_ViewController", referenced from: objc-class-ref in AppDelegate.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)

"_OBJC_CLASS_$_ViewController", referenced from:

clang: error: linker command failed with exit code 1 (use -v to see invocation)

请帮助我

最佳答案

此编译器错误意味着您的 AppDelegate 类正在引用项目中的 ViewController 类,但 ViewController 当前未设置为被编译并包含在最终产品中。

要确保最终产品中包含 ViewController 类,请选择左上列中的蓝色 Xcode 项目图标,如下图所示:

enter image description here

然后在下一列中选择您的目标,然后选择 Build Phases 选项卡,并确保 ViewController.m 一起包含在列表中AppDelegate.m 和其他类似的内容。如果当前不存在,要添加它,您可以将最左侧列中的图标拖放到“编译源” TableView 中,或者单击该 TableView 底部的 + 按钮。

关于iphone - 链接器中的 Xcode 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12178411/

相关文章:

iphone - iOS 配置门户 - App ID

iphone - 如何在 Xcode 中启用 Neon 指令

ios - 在 XCode 4.6 中使用 Subversion

Swift 相机应用程序 - 启用横向模式右/左

iphone - iTunes Connect 说我的 Icon.png 文件是 0x0.. 显然不是!

ios - 在 UITableView 中滚动后 UIButton 颜色发生变化

iphone - 自定义 UIButton

objective-c - cocoa touch ,核心数据: How do I delete all objects for an entity?

iphone - iOS 开发者企业计划和 iOS 开发者计划

iphone - ios - 内存警告和崩溃