2013-01-11 4 views
1

나는 iOS6 용 페이스 북 파서를 쓰고있다. 어제, 저는 파서만으로 테스트 프로젝트를 만들었습니다. 이것은 잘 동작했다. 더 큰 프로젝트 (정확하게 동일한 메소드 코드 사용)에서 파서를 구현하려면 "Parse Error : Expected"가 주어집니다. 소셜 및 계정에 대한 가져 오기가 설정됩니다. 이 오류를주는 라인 :SLRequest가 Parse Error를 준다 : 예상 됨

SLRequest *retrieveWall = [SLRequest requestForServiceType:SLServiceTypeFacebook requestMethod:SLRequestMethodGET URL:newsFeed parameters:nil]; 

이 전체 방법 :

-(void)fetchFacebookFrom:(NSString*)userID withAppKey:(NSString*)appKey 
{ 
    ACAccountStore *accountStore = [[ACAccountStore alloc] init]; 
    ACAccountType *accountType = [accountStore 
            accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook]; 

    NSDictionary *options = @{ 
    @"ACFacebookAppIdKey" : appKey, 
    @"ACFacebookPermissionsKey" : @[@"email"], 
    @"ACFacebookAudienceKey" : ACFacebookAudienceEveryone 
    }; 

    [accountStore requestAccessToAccountsWithType:accountType 
              options:options completion:^(BOOL granted, NSError *error) { 
     if(granted) 
     { 
      NSArray *arrayOfAccounts = [accountStore 
             accountsWithAccountType:accountType]; 

      if ([arrayOfAccounts count] > 0) 
      { 
       ACAccount *facebookAccount = [arrayOfAccounts lastObject]; 

       NSURL *newsFeed = [NSURL URLWithString:@"https://graph.facebook.com/12345678901/feed"]; 

       SLRequest *retrieveWall = [SLRequest requestForServiceType:SLServiceTypeFacebook requestMethod:SLRequestMethodGET URL:newsFeed parameters:nil]; 

       retrieveWall.account = facebookAccount; 

       [retrieveWall performRequestWithHandler:^(NSData *responseData, NSHTTPURLResponse *urlResponse, NSError *error) 
        { 
         if (error) 
         { 
          NSLog(@"Error: %@", [error localizedDescription]); 
         } 
         else 
         { 
          // The output of the request is placed in the log. 
          NSDictionary *jsonResponse = [NSJSONSerialization JSONObjectWithData:responseData options:NSJSONReadingAllowFragments error:nil]; 

          NSArray *statuses = [jsonResponse objectForKey:@"data"]; 
         } 
        }]; 

      } 
     } 
     else 
     { 
      NSLog(@"Not granted"); 
     } 
    }]; 

} 

오류가 specificly 메소드 호출에 "URL"을 가리 킵니다 ..

이 바보에게 오류로 인해 이미 3 시간 동안 미치게되었습니다. Xcode를 다시 시작하고 프로젝트를 정리하고 Mac을 재부팅했습니다. 누가 오류를 볼 수 있습니까?

편집 :이 특정 코드는 문제가 아닌 것으로 보입니다. 핵심 데이터도 추가했는데, 메서드 이름에 URL이있는 일부 함수가 있습니다. 메서드 이름에 URL이있는 모든 함수는 이제 구문 분석 오류를 제공하고 "URL"을 가리 킵니다. 문제에 더 가까워 지지만 여전히 그렇습니다!

+0

내 페이스 북 사용자를 위해 Xcode DP 베타 4, SDK 6.1을 사용하여 코드를 성공적으로 실행했습니다. 오류 없음. – Jano

+1

다음 프레임 워크 가져 오기와 함께 뭔가가 있어야합니다 .. 이것은 iOS 응용 프로그램을 개발하는 것이 나를 귀찮게하는 이유입니다. / – harmjanr

답변

0

헤더 파일의 어딘가에 URL을 정의했습니다. 이걸 제거하면 고칠 수 있습니다. 해결책을 생각해 주셔서 감사합니다!