gpt4 book ai didi

ios - 由于信号 : Segmentation fault: 11 occurred with Eureka 1. 5.0,命令失败

转载 作者:搜寻专家 更新时间:2023-10-31 22:46:22 28 4
gpt4 key购买 nike

当我使用库 Eureka 编译我的 Swift 代码时,出现错误“Command failed due to signal: Segmentation fault: 11”。我正在使用 Xcode 版本 7.3 (7D175)。我的情况类似于this问题。

在上面的问题中,有些人在使用 Eureka 时遇到了同样的错误,但这对我没有帮助。我刚刚创建了一个新项目并完成了“pod install”。然后我添加了“AgeRow.swift”。所以,这个项目是最小的和干净的。

Here是导致段错误错误的小样本。

请确保此示例依赖于 Eureka 1.5.0。

我正在编写名为 AgeInlineRow 的自定义行。当我注释掉 AgeInlineRow 类时,可以编译示例。也就是说,其他代码似乎不是错误的原因。

public final class AgeInlineRow: _AgeInlineRow, RowType, InlineRowType {

required public init(tag: String?) {
super.init(tag: tag)
onExpandInlineRow { cell, row, _ in
let color = cell.detailTextLabel?.textColor
row.onCollapseInlineRow { cell, _, _ in
cell.detailTextLabel?.textColor = color
}
cell.detailTextLabel?.textColor = cell.tintColor
}
}

public override func customDidSelect() {
super.customDidSelect()
if !isDisabled {
toggleInlineRow()
}
}

public func setupInlineRow(inlineRow: InlineRow) {
inlineRow.year_options = self.year_options
inlineRow.month_options = self.month_options
inlineRow.displayValueFor = self.displayValueFor
}
}

当我去掉InlineRowType协议(protocol),修改代码编译后,这个项目就可以编译通过了。所以,我猜原因是 InlineRowType 协议(protocol),这是我调试能力的限制。我不知道如何绕过这个问题。我复制了Eureka的PickerInlineRow代码并修改。当然 PickerInlineRow 不会导致段错误。

如果您能说明原因,我将不胜感激。

下面是错误信息。

0  swift                    0x0000000108f344eb llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 43
1 swift 0x0000000108f337d6 llvm::sys::RunSignalHandlers() + 70
2 swift 0x0000000108f34b4f SignalHandler(int) + 287
3 libsystem_platform.dylib 0x00007fff919e252a _sigtramp + 26
4 swift 0x0000000108d5f78b llvm::FoldingSet<llvm::AttributeSetNode>::NodeEquals(llvm::FoldingSetImpl::Node*, llvm::FoldingSetNodeID const&, unsigned int, llvm::FoldingSetNodeID&) const + 59
5 swift 0x000000010835e15f llvm::CallInst::Create(llvm::FunctionType*, llvm::Value*, llvm::ArrayRef<llvm::Value*>, llvm::ArrayRef<llvm::OperandBundleDefT<llvm::Value*> >, llvm::Twine const&, llvm::Instruction*) + 367
6 swift 0x000000010835e2f0 llvm::IRBuilder<true, llvm::ConstantFolder, llvm::IRBuilderDefaultInserter<true> >::CreateCall(llvm::Value*, llvm::ArrayRef<llvm::Value*>, llvm::Twine const&) + 64
7 swift 0x0000000106d869c5 swift::irgen::IRGenModule::emitSILWitnessTable(swift::SILWitnessTable*) + 1829
8 swift 0x0000000106d1a0dd swift::irgen::IRGenModuleDispatcher::emitGlobalTopLevel() + 861
9 swift 0x0000000106da5a5e performIRGeneration(swift::IRGenOptions&, swift::ModuleDecl*, swift::SILModule*, llvm::StringRef, llvm::LLVMContext&, swift::SourceFile*, unsigned int) + 1278
10 swift 0x0000000106da5f06 swift::performIRGeneration(swift::IRGenOptions&, swift::SourceFile&, swift::SILModule*, llvm::StringRef, llvm::LLVMContext&, unsigned int) + 70
11 swift 0x0000000106c89a1c performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&) + 15004
12 swift 0x0000000106c8541d frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2781
13 swift 0x0000000106c80e3c main + 1932
14 libdyld.dylib 0x00007fff91af25ad start + 1
Stack dump:
0. Program arguments: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c /Users/keta/Documents/Swift/AgeInlineRowSample/AgeInlineRowSample/ViewController.swift /Users/keta/Documents/Swift/AgeInlineRowSample/AgeInlineRowSample/AppDelegate.swift -primary-file /Users/keta/Documents/Swift/AgeInlineRowSample/AgeInlineRowSample/AgeRow.swift -target x86_64-apple-ios9.3 -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.3.sdk -I /Users/keta/Library/Developer/Xcode/DerivedData/AgeInlineRowSample-dpkftrsqyflgpvchqnoeoylaylrj/Build/Products/Debug-iphonesimulator -F /Users/keta/Library/Developer/Xcode/DerivedData/AgeInlineRowSample-dpkftrsqyflgpvchqnoeoylaylrj/Build/Products/Debug-iphonesimulator -F /Users/keta/Library/Developer/Xcode/DerivedData/AgeInlineRowSample-dpkftrsqyflgpvchqnoeoylaylrj/Build/Products/Debug-iphonesimulator/Eureka -enable-testing -g -module-cache-path /Users/keta/Library/Developer/Xcode/DerivedData/ModuleCache -D COCOAPODS -serialize-debugging-options -Xcc -I/Users/keta/Library/Developer/Xcode/DerivedData/AgeInlineRowSample-dpkftrsqyflgpvchqnoeoylaylrj/Build/Intermediates/AgeInlineRowSample.build/Debug-iphonesimulator/AgeInlineRowSample.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/keta/Library/Developer/Xcode/DerivedData/AgeInlineRowSample-dpkftrsqyflgpvchqnoeoylaylrj/Build/Intermediates/AgeInlineRowSample.build/Debug-iphonesimulator/AgeInlineRowSample.build/AgeInlineRowSample-generated-files.hmap -Xcc -I/Users/keta/Library/Developer/Xcode/DerivedData/AgeInlineRowSample-dpkftrsqyflgpvchqnoeoylaylrj/Build/Intermediates/AgeInlineRowSample.build/Debug-iphonesimulator/AgeInlineRowSample.build/AgeInlineRowSample-own-target-headers.hmap -Xcc -I/Users/keta/Library/Developer/Xcode/DerivedData/AgeInlineRowSample-dpkftrsqyflgpvchqnoeoylaylrj/Build/Intermediates/AgeInlineRowSample.build/Debug-iphonesimulator/AgeInlineRowSample.build/AgeInlineRowSample-all-non-framework-target-headers.hmap -Xcc -ivfsoverlay -Xcc /Users/keta/Library/Developer/Xcode/DerivedData/AgeInlineRowSample-dpkftrsqyflgpvchqnoeoylaylrj/Build/Intermediates/AgeInlineRowSample.build/all-product-headers.yaml -Xcc -iquote -Xcc /Users/keta/Library/Developer/Xcode/DerivedData/AgeInlineRowSample-dpkftrsqyflgpvchqnoeoylaylrj/Build/Intermediates/AgeInlineRowSample.build/Debug-iphonesimulator/AgeInlineRowSample.build/AgeInlineRowSample-project-headers.hmap -Xcc -I/Users/keta/Library/Developer/Xcode/DerivedData/AgeInlineRowSample-dpkftrsqyflgpvchqnoeoylaylrj/Build/Products/Debug-iphonesimulator/include -Xcc -I/Users/keta/Library/Developer/Xcode/DerivedData/AgeInlineRowSample-dpkftrsqyflgpvchqnoeoylaylrj/Build/Intermediates/AgeInlineRowSample.build/Debug-iphonesimulator/AgeInlineRowSample.build/DerivedSources/x86_64 -Xcc -I/Users/keta/Library/Developer/Xcode/DerivedData/AgeInlineRowSample-dpkftrsqyflgpvchqnoeoylaylrj/Build/Intermediates/AgeInlineRowSample.build/Debug-iphonesimulator/AgeInlineRowSample.build/DerivedSources -Xcc -DDEBUG=1 -Xcc -DCOCOAPODS=1 -Xcc -working-directory/Users/keta/Documents/Swift/AgeInlineRowSample -emit-module-doc-path /Users/keta/Library/Developer/Xcode/DerivedData/AgeInlineRowSample-dpkftrsqyflgpvchqnoeoylaylrj/Build/Intermediates/AgeInlineRowSample.build/Debug-iphonesimulator/AgeInlineRowSample.build/Objects-normal/x86_64/AgeRow~partial.swiftdoc -Onone -module-name AgeInlineRowSample -emit-module-path /Users/keta/Library/Developer/Xcode/DerivedData/AgeInlineRowSample-dpkftrsqyflgpvchqnoeoylaylrj/Build/Intermediates/AgeInlineRowSample.build/Debug-iphonesimulator/AgeInlineRowSample.build/Objects-normal/x86_64/AgeRow~partial.swiftmodule -serialize-diagnostics-path /Users/keta/Library/Developer/Xcode/DerivedData/AgeInlineRowSample-dpkftrsqyflgpvchqnoeoylaylrj/Build/Intermediates/AgeInlineRowSample.build/Debug-iphonesimulator/AgeInlineRowSample.build/Objects-normal/x86_64/AgeRow.dia -emit-dependencies-path /Users/keta/Library/Developer/Xcode/DerivedData/AgeInlineRowSample-dpkftrsqyflgpvchqnoeoylaylrj/Build/Intermediates/AgeInlineRowSample.build/Debug-iphonesimulator/AgeInlineRowSample.build/Objects-normal/x86_64/AgeRow.d -emit-reference-dependencies-path /Users/keta/Library/Developer/Xcode/DerivedData/AgeInlineRowSample-dpkftrsqyflgpvchqnoeoylaylrj/Build/Intermediates/AgeInlineRowSample.build/Debug-iphonesimulator/AgeInlineRowSample.build/Objects-normal/x86_64/AgeRow.swiftdeps -o /Users/keta/Library/Developer/Xcode/DerivedData/AgeInlineRowSample-dpkftrsqyflgpvchqnoeoylaylrj/Build/Intermediates/AgeInlineRowSample.build/Debug-iphonesimulator/AgeInlineRowSample.build/Objects-normal/x86_64/AgeRow.o

附言我想制作一个包含 UIPickerView 和两个组件的自定义内联行。

最佳答案

我在实现 DateInlineRow 时遇到了这个问题。似乎 swift 编译器无法推断某些类型。

我最终使 DateInlineRow 成为通用类型,即使我不需要 DateInlineRow 的通用类型。

检查 DateInlineRow 实现

/// A row with an NSDate as value where the user can select a date from an inline picker view.
public final class DateInlineRow_<T>: _DateInlineRow, RowType, InlineRowType {
required public init(tag: String?) {
super.init(tag: tag)
onExpandInlineRow { cell, row, _ in
let color = cell.detailTextLabel?.textColor
row.onCollapseInlineRow { cell, _, _ in
cell.detailTextLabel?.textColor = color
}
cell.detailTextLabel?.textColor = cell.tintColor
}
}

public override func customDidSelect() {
super.customDidSelect()
if !isDisabled {
toggleInlineRow()
}
}
}

public typealias DateInlineRow = DateInlineRow_<NSDate>

根据这个,你的实现应该是......

public final class AgeInlineRow_<T>: _AgeInlineRow, RowType, InlineRowType {

.....
}

public typealias AgeInlineRow = AgeInlineRow_<String>

希望对你有帮助

关于ios - 由于信号 : Segmentation fault: 11 occurred with Eureka 1. 5.0,命令失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37359865/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com