我目前正在实施 GData 框架来进行身份验证并发布到 picasa。到目前为止,我有一个工作框架配置。这使我可以推送和验证 / 尝试验证 google。我似乎遇到的唯一问题是当应用程序在身份验证后返回时,我收到崩溃并出现以下错误
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSInvocation invocationWithMethodSignature:]: method signature argument cannot be nil'
*第一掷调用堆栈:(0x281c022 0x43c3cd6 0x2781a52 0x1d134b 0x27824ed 0x2782407 0x1ce0fa 0x1cdf0b 0x1cdebb 0x27824ed 0x2782407 0x22185e 0x221670 0x22270a 0x1926a49 0x1924e84 0x1925ea7 0x1924e3f 0x1924fc5 0x1869f5a 0xca3a39 0xd70596 0xc9a120 0xd70117 0xc99fbf 0x27f094f 0x2753b43 0x2753424 0x2752d84 0x2752c9b 0x29ae7d8 0x29ae88a 0xf23626 0x1c332d 0x2995)
我的验证码如下
NSString *clientID = @"blogityblaablaa";
NSString *clientSecret = @"somecrazycrap";
auth = [GTMOAuth2ViewControllerTouch authForGoogleFromKeychainForName:kKeychainItemName
clientID:clientID
clientSecret:clientSecret];
[[self photoservice] setAuthorizer:auth];
NSString *scope = [GDataServiceGooglePhotos authorizationScope];
SEL finishedSel = @selector(viewController:finishedWithAuth:error:);
GTMOAuth2ViewControllerTouch *viewController;
viewController = [GTMOAuth2ViewControllerTouch controllerWithScope:scope
clientID:clientID
clientSecret:clientSecret
keychainItemName:kKeychainItemName
delegate:self
finishedSelector:finishedSel];
NSString *html = @"<html><body bgcolor=silver><div align=center>Loading sign-in page...</div></body></html>";
viewController.initialHTMLString = html;
[[del navigationController] pushViewController:viewController animated:NO];
无论如何,请提供帮助。非常感谢你!- 吉姆
更新:发生这种情况的原因是由于选择器“finishedSelector:finishedSel”配置错误。当应用程序返回时,找不到选择器,因此会导致此崩溃。上面的身份验证代码运行良好,因此我希望这对需要 oAuth 以进行 GData 身份验证的任何人都有用。谢谢!