无法在Xcode 10.0版本中继承UIButton

时间:2018-09-18 14:58:54

标签: ios swift xcode xcode10

如果我将UIButton子类化,则将Swift 4.0与Xcode 10版本一起使用

我在编译时遇到致命错误

<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 {

}

0 个答案:

没有答案
相关问题