我已经阅读了很多关于SO的帖子,所提出的解决方案都没有为我工作.我希望有人能够更多地了解解释错误可以提供帮助.
我的应用程序一直运行良好(现在仍然如此),但是在使用某个类’iCarousel’时遇到问题,这是一个Cover Flow的实现.
这是有趣的事情:当打开iCarousel的示例项目时,它在我的iPhone上运行正常.我的应用程序(在一个单独的项目中)也运行良好.他们都使用armv6 armv7架构并在iOS 5.1上运行.
然后我将类复制到我自己的项目并添加所有必要的框架.还没有错误.但是当我构建并运行时,我收到一个错误:
Ld /Users/Sooper/Library/Developer/Xcode/DerivedData/TestApp- ejfsezvwxyxhqpanwwrcmsbkslxi/Build/Intermediates/TestApp.build/Debug- iphoneos/TestApp.build/Objects-normal/armv7/TestApp normal armv7 cd "/Users/Sooper/Developer/TestApp v1.0" setenv IPHONEOS_DEPLOYMENT_TARGET 5.0 setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.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 armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk -L/Users/Sooper/Library/Developer/Xcode/DerivedData/TestApp-ejfsezvwxyxhqpanwwrcmsbkslxi/Build/Products/ Debug-iphoneos -F/Users/Sooper/Library/Developer/Xcode/DerivedData/TestApp-ejfsezvwxyxhqpanwwrcmsbkslxi/Build/Products/ Debug-iphoneos -filelist /Users/Sooper/Library/Developer/Xcode/DerivedData/TestApp-ejfsezvwxyxhqpanwwrcmsbkslxi/Build/Intermediates/TestApp.build/ Debug-iphoneos/TestApp.build/Objects-normal/armv7/TestApp.LinkFileList -dead_strip -miphoneos- version-min=5.0 -lz -framework QuartzCore -framework CoreGraphics -framework SystemConfiguration -lxml2.2.7.3 -framework Security -framework CoreMedia -framework Accounts -framework CoreFoundation -framework AudioToolBox -framework AVFoundation -framework Twitter - framework MediaPlayer -framework UIKit -framework Foundation -o /Users/Sooper/Library/Developer/Xcode/DerivedData/TestApp- ejfsezvwxyxhqpanwwrcmsbkslxi/Build/Intermediates/TestApp.build/Debug- iphoneos/TestApp.build/Objects-normal/armv7/TestApp
在此之下:
Undefined symbols for architecture armv7: "_OBJC_CLASS_$_ArtworkScrollerViewController",referenced from: objc-class-ref in TestAppViewController.o ld: symbol(s) not found for architecture armv7 clang: error: linker command Failed with exit code 1 (use -v to see invocation)
如果我删除了类的实例,则错误消失并且应用程序运行.我完全糊涂了.为什么它会单独工作而不能在另一个项目中工作?
非常感谢一些指导.
解决方法
确保将ArtworkScrollerViewController.m添加到您正在构建的目标