2014-06-20 2 views
2

저는 Half로 시작한 프로젝트를 Swift로 변환하여 기초와 단점에 대해 배웁니다. 내가 사용하고있는 라이브러리 (AFOAuth2Client)의 업데이트/포크 없이는 해결할 수없는 문제가 있음을 발견했습니다.Swift에서 동일한 서명을 가진 Obj-C 메소드 호출하기

AFOAuth2Client의 authenticateUsingOAuthWithPath: scope: success: failure: 메서드를 호출하려고합니다. 그러나 authenticateUsingOAuthWithPath:으로 시작하는 4 가지 다른 방법도 있습니다. 내 PARAMS 다른 비록

는 신속한 컴파일러 (엑스 코드 베타 2)

" 'authenticateUsingOAuthWithPath'의 모호한 사용을"말을 나에게 불평한다. AFOauth2Client의 헤더는 다음과 같은 문제 causers을 정의

 
client.authenticateUsingOAuthWithPath(path: "string here", scope: "string here", success: { (cred: AFOAuthCredential!) -> Void in 

    // Success 

}, failure: { (error: NSError!) -> Void in 

    // Failure 

}) 

내가 할 노력하고있어 볼 필요가있는 사람들을 위해

... ...

 
- (void)authenticateUsingOAuthWithPath:(NSString *)path 
           scope:(NSString *)scope 
           success:(void (^)(AFOAuthCredential *credential))success 
           failure:(void (^)(NSError *error))failure; 

- (void)authenticateUsingOAuthWithPath:(NSString *)path 
          refreshToken:(NSString *)refreshToken 
           success:(void (^)(AFOAuthCredential *credential))success 
           failure:(void (^)(NSError *error))failure; 

- (void)authenticateUsingOAuthWithPath:(NSString *)path 
            code:(NSString *)code 
          redirectURI:(NSString *)uri 
           success:(void (^)(AFOAuthCredential *credential))success 
           failure:(void (^)(NSError *error))failure; 

- (void)authenticateUsingOAuthWithPath:(NSString *)path 
          parameters:(NSDictionary *)parameters 
           success:(void (^)(AFOAuthCredential *credential))success 
           failure:(void (^)(NSError *error))failure; 

수 누구나 특정 방법을 신속하게 지적하거나 포크/변경해야한다는 사실을 알리는 제안을하는 사람이 있습니까?

+2

: "문자열 여기 ""? – Kreiri

+0

내 하나님, 그게 간단했다! 감사합니다 Kreiri – spamoom

+0

@ Kreiri 당신이 실제 답변으로 받아 들일 수 있도록 작성해야 – drewag

답변

1

사용

client.authenticateUsingOAuthWithPath("string here"

대신 당신이 "여기에 문자열을"`client.authenticateUsingOAuthWithPath을 (할 경우 (대신 client.authenticateUsingOAuthWithPath`의`경로를 무슨

client.authenticateUsingOAuthWithPath(path: "string here"

관련 문제