我正在尝试从 gmail 帐户获取联系人并收到此错误:
"ViewController" selector "ticket:finishedWithFeed:" should have 3 arguments
*** Assertion failure in void GTMAssertSelectorNilOrImplementedWithArgs(id, SEL, ...)(),
/gtm-oauth2/GTMHTTPFetcher.m:1607
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'callback selector arguments incorrect'
-(void)getGoogleContacts {
GDataServiceGoogleContact *service =
[[GDataServiceGoogleContact alloc] init];
NSString *username = @"username@gmail.com";
NSString *password = @"pass";
service = [[GDataServiceGoogleContact alloc] init];
[service setUserAgent:@"McGraggerSoft-GoogleContactUtility-1.0"];
[service setUserCredentialsWithUsername:username password:password];
ticket = [service fetchContactFeedForUsername:username delegate:self didFinishSelector:@selector(ticket:finishedWithFeed:)];
}
- (void)ticket:(GDataServiceTicket *)ticket finishedWithFeed:(GDataFeedContact *)feed
{
if ([[feed entries] count] > 0) {
GDataEntryContact *firstContact = [[feed entries] objectAtIndex:0];
GDataTextConstruct *titleTextConstruct = [firstContact title];
NSString *title = [titleTextConstruct stringValue];
NSLog(@"first contact's title:%@", title);
}
}
- (void)viewDidLoad
{
[super viewDidLoad];
[self getGoogleContacts];
}