2013-01-10 1 views
0

iOS 앱에 MGTwitterEngine SDK를 사용하고 있습니다. 이 방법은 항상이 형식으로 문자열하지만 동일하지 반환MGTwitterEngine 사용자를 따라 가는지 확인합니다.

- (NSString *)isUser:(NSString *)username1 receivingUpdatesFor:(NSString *)username2 
{ 
    if (!username1 || !username2) { 
     return nil; 
    } 
    NSMutableDictionary *params = [NSMutableDictionary dictionaryWithCapacity:0]; 
    [params setObject:username1 forKey:@"user_a"]; 
    [params setObject:username2 forKey:@"user_b"]; 

    NSString *path = [NSString stringWithFormat:@"friendships/exists.%@", API_FORMAT]; 

    return [self _sendRequestWithMethod:nil path:path queryParameters:params body:nil 
          requestType:MGTwitterUpdatesCheckRequest 
          responseType:MGTwitterMiscellaneous]; 
} 

: 기본적으로

CB4C097E-6740-4536-885E-BAF7D8A981FD 

를이 것 나는 사용자가이 방법으로 다른 사용자를 따르고 있는지 확인하려고 부울 값을 얻는 것이 낫다면,이 값으로 무엇을 할 것인지에 대한 단서가 없습니다.

어떤 아이디어가 있습니까?

** _engine이, 당신은 MGTwitterEngine의 대리인으로 클래스를 설정하고 구현해야한다는, 이러한 방법의 결과를 얻기 위해 비동기 요청이됩니다

 _engine = [[SA_OAuthTwitterEngine alloc] initOAuthWithDelegate: self]; 
    _engine.consumerKey = kOAuthConsumerKey; 
    _engine.consumerSecret = kOAuthConsumerSecret; 
+0

위의 결과를 확인하거나 반환 값을 읽는 중입니까? –

+0

반환 값을 로그에 출력하고 있는데 어떻게 위임자를 확인할 수 있습니까? –

+0

하지만 반환 값은 델리게이트에서 왔습니다 –

답변

1

초기화 코드 편집 당신의 클래스 :

- (void)statusesReceived:(NSArray *)statuses forRequest:(NSString *)connectionIdentifier; 
- (void)directMessagesReceived:(NSArray *)messages forRequest:(NSString *)connectionIdentifier; 
- (void)userInfoReceived:(NSArray *)userInfo forRequest:(NSString *)connectionIdentifier; 
- (void)miscInfoReceived:(NSArray *)miscInfo forRequest:(NSString *)connectionIdentifier; 

당신은 MGTwitterEngineDelegate.h에서 읽을 수 있듯이 :

// These delegate methods are called after all results are parsed from the connection. If 
// the deliveryOption is configured for MGTwitterEngineDeliveryAllResults (the default), a 
// collection of all results is also returned. 

여기에서 결과 값을 확인할 수 있습니다.

+0

저는 클래스를 델리게이트로 설정했지만 메소드는 호출되지 않습니다. MGTwitterEngine 클래스에도 없음 –

+0

소비자 키와 비밀 키로 초기화 했습니까? 첫 번째 게시물 편집 ome 코드 게시하시기 바랍니다. –

+0

이 추가되었습니다. _engine에는 속성 대리자가 없습니다 –

관련 문제