Three20 无法在 iOS 设备上编译,因为 _searchController 未在 TTTableViewController 子类中定义
我有一个 TTTableViewController 子类。在 loadView 中,我将 searchBar 分配给 headerView,如 TTCatalog 中所示:
self.tableView.tableHeaderView = _searchController.searchBar;
当我为 iPhone Simulator 编译时,一切正常;当我为 iOS 设备编译器进行编译时,出现错误,提示 _searchController 未定义。
有人可以指出我正确的方向吗? 我已经尝试过在这里和网上找到的其他解决方案...但似乎没有什么可以解决问题...
在编译器输出下方(有点长):
CompileC /Users/Luca/Library/Developer/Xcode/DerivedData/QShopping-eggzghjfaglpblfzueetmvwsljou/Build/Intermediates/QShopping.build/Debug-iphoneos/QShopping.build/Objects-normal/armv7/SearchProducts.o QShopping/Classes/SearchProducts.m normal armv7 objective-c com.apple.compilers.llvmgcc42 cd /Users/Luca/Dropbox/XcodeProjects/QShopping setenv LANG en_US.US-ASCII setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-gcc-4.2 -x objective-c -arch armv7 -fmessage-length=0 -pipe -std=gnu99 -Wno-trigraphs -fpascal-strings -O0 -Wreturn-type -Wunused-variable -DDEBUG -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk -gdwarf-2 -mthumb -miphoneos-version-min=4.0 -iquote /Users/Luca/Library/Developer/Xcode/DerivedData/QShopping-eggzghjfaglpblfzueetmvwsljou/Build/Intermediates/QShopping.build/Debug-iphoneos/QShopping.build/QShopping-generated-files.hmap -I/Users/Luca/Library/Developer/Xcode/DerivedData/QShopping-eggzghjfaglpblfzueetmvwsljou/Build/Intermediates/QShopping.build/Debug-iphoneos/QShopping.build/QShopping-own-target-headers.hmap -I/Users/Luca/Library/Developer/Xcode/DerivedData/QShopping-eggzghjfaglpblfzueetmvwsljou/Build/Intermediates/QShopping.build/Debug-iphoneos/QShopping.build/QShopping-all-target-headers.hmap -iquote /Users/Luca/Library/Developer/Xcode/DerivedData/QShopping-eggzghjfaglpblfzueetmvwsljou/Build/Intermediates/QShopping.build/Debug-iphoneos/QShopping.build/QShopping-project-headers.hmap -I/Users/Luca/Library/Developer/Xcode/DerivedData/QShopping-eggzghjfaglpblfzueetmvwsljou/Build/Products/Debug-iphoneos/include -I/Users/Luca/Library/Developer/Xcode/DerivedData/QShopping-eggzghjfaglpblfzueetmvwsljou/Build/Products/Debug-iphoneos/../three20 -I/Users/Luca/Library/Developer/Xcode/DerivedData/QShopping-eggzghjfaglpblfzueetmvwsljou/Build/Products/Debug-iphoneos/../../three20 -I../three20/Build/Products/three20 -I/Users/Luca/Dropbox/XcodeProjects/QShopping/RestKit/Build -I/Users/Luca/Library/Developer/Xcode/DerivedData/QShopping-eggzghjfaglpblfzueetmvwsljou/Build/Products/Debug-iphoneos/../../three20 -I/Users/Luca/Library/Developer/Xcode/DerivedData/QShopping-eggzghjfaglpblfzueetmvwsljou/Build/Intermediates/QShopping.build/Debug-iphoneos/QShopping.build/DerivedSources/armv7 -I/Users/Luca/Library/Developer/Xcode/DerivedData/QShopping-eggzghjfaglpblfzueetmvwsljou/Build/Intermediates/QShopping.build/Debug-iphoneos/QShopping.build/DerivedSources -F/Users/Luca/Library/Developer/Xcode/DerivedData/QShopping-eggzghjfaglpblfzueetmvwsljou/Build/Products/Debug-iphoneos -include /Users/Luca/Library/Developer/Xcode/DerivedData/QShopping-eggzghjfaglpblfzueetmvwsljou/Build/PrecompiledHeaders/QShopping-Prefix-equrcyqgwoemcbaiznvexuztfkfm/QShopping-Prefix.pch -c /Users/Luca/Dropbox/XcodeProjects/QShopping/QShopping/Classes/SearchProducts.m -o /Users/Luca/Library/Developer/Xcode/DerivedData/QShopping-eggzghjfaglpblfzueetmvwsljou/Build/Intermediates/QShopping.build/Debug-iphoneos/QShopping.build/Objects-normal/armv7/SearchProducts.o
/Users/Luca/Dropbox/XcodeProjects/QShopping/QShopping/Classes/SearchProducts.m: In function '-[SearchProducts loadView]': /Users/Luca/Dropbox/XcodeProjects/QShopping/QShopping/Classes/SearchProducts.m:121: error: '_searchController' undeclared (first use in this function) /Users/Luca/Dropbox/XcodeProjects/QShopping/QShopping/Classes/SearchProducts.m:121: error: (Each undeclared identifier is reported only once /Users/Luca/Dropbox/XcodeProjects/QShopping/QShopping/Classes/SearchProducts.m:121: error: for each function it appears in.) /Users/Luca/Dropbox/XcodeProjects/QShopping/QShopping/Classes/SearchProducts.m: In function '-[SearchProducts textField:didSelectObject:]': /Users/Luca/Dropbox/XcodeProjects/QShopping/QShopping/Classes/SearchProducts.m:180: error: '_searchController' undeclared (first use in this function)
I've a TTTableViewController subclass. In the loadView I'm assigning the searchBar to the headerView as shown in TTCatalog:
self.tableView.tableHeaderView = _searchController.searchBar;
When I compile for iPhone Simulator all is ok; when I compile for iOS Device compiler give me an error saying _searchController is undefined.
Someone can point me to the right direction??
I already tried some other solution found here and on net... but nothing seems to resolve the issue...
Below the compiler output (a little long):
CompileC /Users/Luca/Library/Developer/Xcode/DerivedData/QShopping-eggzghjfaglpblfzueetmvwsljou/Build/Intermediates/QShopping.build/Debug-iphoneos/QShopping.build/Objects-normal/armv7/SearchProducts.o QShopping/Classes/SearchProducts.m normal armv7 objective-c com.apple.compilers.llvmgcc42 cd /Users/Luca/Dropbox/XcodeProjects/QShopping setenv LANG en_US.US-ASCII setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-gcc-4.2 -x objective-c -arch armv7 -fmessage-length=0 -pipe -std=gnu99 -Wno-trigraphs -fpascal-strings -O0 -Wreturn-type -Wunused-variable -DDEBUG -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk -gdwarf-2 -mthumb -miphoneos-version-min=4.0 -iquote /Users/Luca/Library/Developer/Xcode/DerivedData/QShopping-eggzghjfaglpblfzueetmvwsljou/Build/Intermediates/QShopping.build/Debug-iphoneos/QShopping.build/QShopping-generated-files.hmap -I/Users/Luca/Library/Developer/Xcode/DerivedData/QShopping-eggzghjfaglpblfzueetmvwsljou/Build/Intermediates/QShopping.build/Debug-iphoneos/QShopping.build/QShopping-own-target-headers.hmap -I/Users/Luca/Library/Developer/Xcode/DerivedData/QShopping-eggzghjfaglpblfzueetmvwsljou/Build/Intermediates/QShopping.build/Debug-iphoneos/QShopping.build/QShopping-all-target-headers.hmap -iquote /Users/Luca/Library/Developer/Xcode/DerivedData/QShopping-eggzghjfaglpblfzueetmvwsljou/Build/Intermediates/QShopping.build/Debug-iphoneos/QShopping.build/QShopping-project-headers.hmap -I/Users/Luca/Library/Developer/Xcode/DerivedData/QShopping-eggzghjfaglpblfzueetmvwsljou/Build/Products/Debug-iphoneos/include -I/Users/Luca/Library/Developer/Xcode/DerivedData/QShopping-eggzghjfaglpblfzueetmvwsljou/Build/Products/Debug-iphoneos/../three20 -I/Users/Luca/Library/Developer/Xcode/DerivedData/QShopping-eggzghjfaglpblfzueetmvwsljou/Build/Products/Debug-iphoneos/../../three20 -I../three20/Build/Products/three20 -I/Users/Luca/Dropbox/XcodeProjects/QShopping/RestKit/Build -I/Users/Luca/Library/Developer/Xcode/DerivedData/QShopping-eggzghjfaglpblfzueetmvwsljou/Build/Products/Debug-iphoneos/../../three20 -I/Users/Luca/Library/Developer/Xcode/DerivedData/QShopping-eggzghjfaglpblfzueetmvwsljou/Build/Intermediates/QShopping.build/Debug-iphoneos/QShopping.build/DerivedSources/armv7 -I/Users/Luca/Library/Developer/Xcode/DerivedData/QShopping-eggzghjfaglpblfzueetmvwsljou/Build/Intermediates/QShopping.build/Debug-iphoneos/QShopping.build/DerivedSources -F/Users/Luca/Library/Developer/Xcode/DerivedData/QShopping-eggzghjfaglpblfzueetmvwsljou/Build/Products/Debug-iphoneos -include /Users/Luca/Library/Developer/Xcode/DerivedData/QShopping-eggzghjfaglpblfzueetmvwsljou/Build/PrecompiledHeaders/QShopping-Prefix-equrcyqgwoemcbaiznvexuztfkfm/QShopping-Prefix.pch -c /Users/Luca/Dropbox/XcodeProjects/QShopping/QShopping/Classes/SearchProducts.m -o /Users/Luca/Library/Developer/Xcode/DerivedData/QShopping-eggzghjfaglpblfzueetmvwsljou/Build/Intermediates/QShopping.build/Debug-iphoneos/QShopping.build/Objects-normal/armv7/SearchProducts.o
/Users/Luca/Dropbox/XcodeProjects/QShopping/QShopping/Classes/SearchProducts.m: In function '-[SearchProducts loadView]': /Users/Luca/Dropbox/XcodeProjects/QShopping/QShopping/Classes/SearchProducts.m:121: error: '_searchController' undeclared (first use in this function) /Users/Luca/Dropbox/XcodeProjects/QShopping/QShopping/Classes/SearchProducts.m:121: error: (Each undeclared identifier is reported only once /Users/Luca/Dropbox/XcodeProjects/QShopping/QShopping/Classes/SearchProducts.m:121: error: for each function it appears in.) /Users/Luca/Dropbox/XcodeProjects/QShopping/QShopping/Classes/SearchProducts.m: In function '-[SearchProducts textField:didSelectObject:]': /Users/Luca/Dropbox/XcodeProjects/QShopping/QShopping/Classes/SearchProducts.m:180: error: '_searchController' undeclared (first use in this function)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
好吧,我解决了将编译器从 GCC 4.2(系统默认)更改为 LVVM 2 的问题。
Well, I resolved changing compiler from GCC 4.2 (System Default) to LVVM 2.
而不是:
尝试:
这对我的项目很有帮助!
Instead of:
try:
it was helpful for my project!
那应该有效。您可能在某处保存了旧的 Three20 标头。
/Users/Luca/Library/Developer/Xcode/DerivedData/
。That's should work. You might have old three20 headers saved somewhere.
/Users/Luca/Library/Developer/Xcode/DerivedData/
.