【问题标题】:Error while compiling xcode. ibtools could not find class named UIImage编译 xcode 时出错。 ibtools 找不到名为 UIImage 的类
【发布时间】:2018-04-29 18:30:00
【问题描述】:

我在编译传递给我的项目时在 Xcode 中收到此错误消息:

CompileStoryboard proj1/Base.lproj/Main.storyboard
    cd /Users/user1/Documents/Projects/MyProject/iOS/MyProject_iOS
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    export XCODE_DEVELOPER_USR_PATH=/Applications/Xcode.app/Contents/Developer/usr/bin/..
    /Applications/Xcode.app/Contents/Developer/usr/bin/ibtool --errors --warnings --notices --module proj1 --output-partial-info-plist /Users/user1/Library/Developer/Xcode/DerivedData/proj1-aevyxfxutfenlmbqvkeyzpywwekg/Build/Intermediates.noindex/proj1.build/Debug-iphonesimulator/proj1.build/Main-SBPartialInfo.plist --auto-activate-custom-fonts --target-device iphone --minimum-deployment-target 8 --output-format human-readable-text --compilation-directory /Users/user1/Library/Developer/Xcode/DerivedData/proj1-aevyxfxutfenlmbqvkeyzpywwekg/Build/Intermediates.noindex/proj1.build/Debug-iphonesimulator/proj1.build/Base.lproj /Users/user1/Documents/Projects/MyProject/iOS/MyProject_iOS/proj1/Base.lproj/Main.storyboard
2017-11-16 17:12:26.655 ibtoold[20474:699803] *** Assertion failure in -[IBBinaryUnarchiver classForClassName:], /Library/Caches/com.apple.xbs/Sources/IDEInterfaceBuilder/IDEInterfaceBuilder-13529/Foundation/Utilities/IBBinaryUnarchiver.m:316
/* com.apple.ibtool.document.warnings */
/Users/user1/Documents/Projects/MyProject/iOS/MyProject_iOS/proj1/Base.lproj/Main.storyboard:TiJ-pH-k9k: warning: Automatic Preferred Max Layout Width before iOS 8.0
/Users/user1/Documents/Projects/MyProject/iOS/MyProject_iOS/proj1/Base.lproj/Main.storyboard:iOT-6X-DYN: warning: Automatic Preferred Max Layout Width before iOS 8.0
/Users/user1/Documents/Projects/MyProject/iOS/MyProject_iOS/proj1/Base.lproj/Main.storyboard:U3p-FK-Uaj: warning: Automatic Preferred Max Layout Width before iOS 8.0
/Users/user1/Documents/Projects/MyProject/iOS/MyProject_iOS/proj1/Base.lproj/Main.storyboard:HrH-hF-d04: warning: Automatic Preferred Max Layout Width before iOS 8.0
/Users/user1/Documents/Projects/MyProject/iOS/MyProject_iOS/proj1/Base.lproj/Main.storyboard:g6v-21-vpr: warning: Automatic Preferred Max Layout Width before iOS 8.0
/Users/user1/Documents/Projects/MyProject/iOS/MyProject_iOS/proj1/Base.lproj/Main.storyboard:FyA-39-0eM: warning: Prototype collection view cells must have reuse identifiers
/Users/user1/Documents/Projects/MyProject/iOS/MyProject_iOS/proj1/Base.lproj/Main.storyboard:hHE-SH-oro: warning: Automatic Preferred Max Layout Width before iOS 8.0
/Users/user1/Documents/Projects/MyProject/iOS/MyProject_iOS/proj1/Base.lproj/Main.storyboard:mf7-kd-Iuk: warning: Automatic Preferred Max Layout Width before iOS 8.0
/Users/user1/Documents/Projects/MyProject/iOS/MyProject_iOS/proj1/Base.lproj/Main.storyboard:3lL-wL-gSf: warning: Automatic Preferred Max Layout Width before iOS 8.0
/Users/user1/Documents/Projects/MyProject/iOS/MyProject_iOS/proj1/Base.lproj/Main.storyboard:sdL-YA-l1j: warning: Automatic Preferred Max Layout Width before iOS 8.0
/Users/user1/Documents/Projects/MyProject/iOS/MyProject_iOS/proj1/Base.lproj/Main.storyboard:QgI-8L-Hco: warning: Automatic Preferred Max Layout Width before iOS 8.0
/* com.apple.ibtool.errors */
/Users/user1/Documents/Projects/MyProject/iOS/MyProject_iOS/proj1/Base.lproj/Main.storyboard: error: Exception while running ibtool: Could not find class named UIImage

我已尝试清理和删除派生数据文件夹并重新构建,但仍然出现相同的错误。我在 Xcode 9.1 上运行。

请帮忙。谢谢。

【问题讨论】:

标签: ios objective-c xcode uiimage


【解决方案1】:

将 uikit 导入到视图控制器的头文件中。

就像在 viewcontroller.h 中一样

添加下一行 #import <UIKit/UIKit.h>

我认为这将解决您的问题。

【讨论】:

  • 我检查了所有的 .h 文件。他们有 #import 但我仍然无法编译。请帮忙。
  • 如果其他项目运行,则编译它们,然后为此创建新项目。可能这是链接错误的问题。如果其他项目也抛出同样的错误,那么重新安装你的 xcode。
猜你喜欢
  • 1970-01-01
  • 2014-12-14
  • 1970-01-01
  • 1970-01-01
  • 2016-07-25
  • 2019-03-13
  • 1970-01-01
  • 1970-01-01
  • 2017-03-29
相关资源
最近更新 更多