使用swift 3错误进行AWS Dynamodb测试

Keg*_* K. 1 xcode overriding amazon-web-services ios swift

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

/ Users/*****_*****/Desktop/APPS/Beer On The Go/AmazonAws/Models/NoSQL/Bars.swift:57:16:方法'JSONKeyPathsByPropertyKey()'与Objective-C选择器' JSONKeyPathsByPropertyKey'与来自超类'AWSDynamoDBObjectModel'的方法'jsonKeyPathsByPropertyKey()'冲突,具有相同的Objective-C选择器

有什么提示可以解决这个问题吗?

    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,
    ]
}
Run Code Online (Sandbox Code Playgroud)

错误消息

Ale*_*gin 5

您必须使用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
    ]
}
Run Code Online (Sandbox Code Playgroud)