ios - 无法在 Xcode 10.0 版本中继承 UIButton
问题描述
使用 Swift 4.0 和 Xcode 10 版本,如果我继承 UIButton
我在编译时遇到致命错误
<unknown>:0: error: fatal error encountered while reading from module 'Target_name'; please file a bug report with your project and the crash log
*** DESERIALIZATION FAILURE (please include this section in any bug report) ***
could not find 'init(frame:)' in parent class
0 swift 0x000000010829f64a PrintStackTraceSignalHandler(void*) + 42
1 swift 0x000000010829edfe SignalHandler(int) + 302
2 libsystem_platform.dylib 0x00007fff5beb4b3d _sigtramp + 29
3 libsystem_platform.dylib 0x00000001156687c7 _sigtramp + 3111861415
4 libsystem_c.dylib 0x00007fff5bd731c9 abort + 127
5 swift 0x00000001057050fb. swift::ModuleFile::fatal(llvm::Error) + 1915
6 swift 0x000000010573c753 getSILDeclRef(swift::ModuleFile*, llvm::ArrayRef<unsigned long long>, unsigned int&) + 307
7 swift 0x000000010573ea94 swift::SILDeserializer::readVTable(llvm::PointerEmbeddedInt<unsigned int, 31>) + 740
8 swift 0x00000001057e584b swift::SerializedSILLoader::getAllForModule(swift::Identifier, swift::FileUnit*) + 331
9 swift 0x000000010452f9be performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 34558
10 swift 0x0000000104523dc5 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 7717
11 swift 0x00000001044c9a35 main + 1349
12 libdyld.dylib 0x00007fff5bccb085 start + 1
'While deserializing SIL vtable for 'UIButtonRounded' in module'Target_Name'
error: Abort trap: 6'
这是我的课
class UIButtonRounded: UIButton {
}
解决方案
推荐阅读
- linux - 如何更改 openshift 容器平台中的权限?
- reactjs - Who can verify my implementation of react menu?
- python - 密谋失踪的逆戟鲸
- python-3.x - 这个递归函数是如何工作的,是关于计算结构的吗?
- javascript - 如何在没有服务器的情况下运行 Angular8 dist 文件夹
- java - 程序类型已经存在:androidx.recyclerview.widget.AdapterHelper$Callback
- javascript - Javascript上传功能
- c++ - C - 对双变量求和会根据其编写方式给出不同的输出
- python - 如何将列表列表转换为带有新行的字符串
- javascript - javascript template litreral in side a react link tag to={} attribute