2016-09-18 4 views
1

정말 인터넷을 통해 솔루션을 찾을 수없는 경우를 제외하고는 stackoverflow에 대한 질문을하지 않습니다. 여기에는 우선적 인 메서드 문제가 있습니다. 이것은 DynamoDB에 대한 AWS 생성 코드입니다. 임 내가이 오류를 얻을 무시하지만 사용을 제거하기 위해 노력 3.0 빠른 사용 :신속한 3 오류를 사용하여 AWS Dynamodb 테스트

/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

어떤 힌트를이 문제를 해결하기를? Error msg

+0

는 이중의 반환 형식을 확인해 봤어 슈퍼 클래스 메소드? – Paulw11

+0

Keg - 아래에서 훌륭한 답을 찾아야합니다! – Fattie

답변

5

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, 
    ] 
} 

당신은 스위프트 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 
    ] 
} 
+0

위대한 팁에 감사드립니다! – Fattie

+0

다음은이 시대에 동일한 샘플 코드를 사용하면서 발생하는 문제입니다. 여기에 고글 치는 사람을 도울 수 있습니다. http://stackoverflow.com/questions/40615830/weird-swift-3-issue-with-latest-amazon-aws-mobile-sample-code – Fattie

관련 문제