gpt4 book ai didi

ios - AWS Dynamodb测试使用swift 3报错

转载 作者:搜寻专家 更新时间:2023-11-01 06:05:11 25 4
gpt4 key购买 nike

我真的不问关于 stackoverflow 的问题,除非我真的无法在整个互联网上找到解决方案。我这里有一个压倒一切的方法问题。这是 AWS 为 DynamoDB 生成的代码。我正在使用 swift 3.0我试图删除覆盖但没有用我得到这个错误:

/Users/*****_*****/Desktop/APPS/Beer On The Go/AmazonAws/Models/NoSQL/Bars.swift:57:16: Method 'JSONKeyPathsByPropertyKey()' with Objective-C selector 'JSONKeyPathsByPropertyKey' conflicts with method 'jsonKeyPathsByPropertyKey()' from superclass 'AWSDynamoDBObjectModel' with the same Objective-C selector

有解决这个问题的提示吗?

    override class func JSONKeyPathsByPropertyKey() -> [NSObject : AnyObject] {
return [
"_userId" as NSObject : "userId" as AnyObject,
"_barId" as NSObject : "barId" as AnyObject,
"_category" as NSObject : "Category" as AnyObject,
"_description" as NSObject : "Description" as AnyObject,
"_name" as NSObject : "Name" as AnyObject,
]
}

Error msg

最佳答案

您必须使用 Swift 3 实现的更新类型和新方法名称(注意小写的“json”):

public override static func jsonKeyPathsByPropertyKey() -> [AnyHashable : Any]
return [
"_userId" as AnyHashable : "userId" as Any,
"_barId" as AnyHashable : "barId" as Any,
"_category" as AnyHashable : "Category" as Any,
"_description" as AnyHashable : "Description" as Any,
"_name" as AnyHashable : "Name" as Any
]
}

关于ios - AWS Dynamodb测试使用swift 3报错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39562764/

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