2014-11-02 6 views
0

누구든지 SBJson 라이브러리를 신속하게 사용하는 방법을 알고 있습니까?SBJson and swift

내가 목표 - C

NSString *responseString = [request responseString]; 
NSDictionary *responseDict = [responseString JSONValue]; 

이 코드는

var responseString = request.responseString 
let responseDict: NSDictionary = responseString.JSONValue 

엑스 코드 불평

으로 시도했습니다 "() -> 문자열 JSONValue라는 이름의 회원이 없습니다"

I을 포함됨

#import "SBJson.h" 

"MyProjectName"-Bridging-Header.h

답변

0

방금 ​​발견 : SBJson의 확장은 NSString 유형에 적용되지만 Swift String 유형은 다른 것입니다.

그것은이 코드와 함께 작동

:

var responseString: NSString = request.responseString() 
let responseDict: NSDictionary = responseString.JSONValue() as NSDictionary