2016-10-10 6 views
1

방금 ​​3으로 프로젝트를 업데이트했습니다.영역 LazyFilterBidirectionalCollection 오류 Swift 3

저는 Swift 기능에서 매우 녹색입니다.

Cannot convert return expression of type 'LazyFilterBidirectionalCollection>' to return type '[Point]'

나는이 잘못 뭐하는 거지 : 어쨌든, 난이 쿼리의 방법 마녀 내가이 오류가 시작 업데이트 후, 미세

func getAllPointsWithCategory(_ idCategory:String) -> [Point] { 
    let realm = try! Realm() 
    let containingPOI = realm.objects(Point.self).filter({ (poi) -> Bool in 
     return poi.categories.contains(where: { (cat) -> Bool in 
      return idCategory == cat.id 
     }) 
    }) 

    return containingPOI 
} 

을 일하고 있었다? 사전에 어떤 도움

덕분에

답변

0

영역 쿼리 Results 유형,하지 Array을 반환합니다. ResultsArray으로 변환하는 방법에 대해 https://github.com/realm/realm-cocoa/issues/1046을 확인하십시오.

+3

Stil이 오류를 수신하는 이유는 무엇입니까? "LazyFilterBidirectionalCollection"이 나타나는 이유는 무엇입니까? 이것은 신속한 2.0과 함께 일하고 있었다. – DaSilva