Three20无法在iOS设备上编译导致_searchController未在TTTableViewController子类中定义

时间:2011-07-18 21:15:56

标签: compiler-construction xcode4 three20 device

我有一个TTTableViewController子类。在loadView中,我将searchBar分配给headerView,如TTCatalog中所示:

self.tableView.tableHeaderView = _searchController.searchBar;

当我为iPhone模拟器编译时,一切正常;当我编译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)

3 个答案:

答案 0 :(得分:2)

好吧,我解决了将编译器从GCC 4.2(系统默认值)更改为LVVM 2的问题。

答案 1 :(得分:1)

而不是:

self.tableView.tableHeaderView = _searchController.searchBar;

尝试:

self.tableView.tableHeaderView = self.searchDisplayController.searchBar;

这对我的项目很有帮助!

答案 2 :(得分:0)

这应该有效。您可能在某处保存了旧的三十二个标题。

  • 尝试清理项目并重建所有内容。
  • 尝试删除所有旧版本 /Users/Luca/Library/Developer/Xcode/DerivedData/
  • 删除构建设置中对three20的任何引用,并在项目中再次运行three20脚本