我在编译一个传递给我的项目时在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上运行。
请帮忙。感谢。
答案 0 :(得分:0)
将uikit导入视图控制器的头文件中。
像在viewcontroller.h中一样添加以下行
#import <UIKit/UIKit.h
&GT;
我认为这可以解决您的问题。