ios - WACloudAccessControlClient may not respond to setToken?

﹥>﹥吖頭↗ 提交于 2019-12-12 03:55:42

问题


I'm trying to get token,but getting warning message like 'WACloudAccessControlClient, may not respond to setToken

 - (BOOL)webView:(UIWebView *)webView
shouldStartLoadWithRequest:(NSURLRequest *)request
 navigationType:(UIWebViewNavigationType)navigationType
{

    NSURL *url = [[NSURL alloc] initWithString:@"URL"];

if(url)

{

 /* make the call re-entrant when we re-load the content ourselves */

    if([url isEqual:[request URL]])
    {
        return YES;
    }

    [url release];
}

url = [[request URL] retain];
NSString* scheme = [url scheme];

if([scheme isEqualToString:@"acs"])
{
    // parse the JSON URL parameter into a dictionary
    NSDictionary* pairs = [self parsePairs:[url absoluteString]];
    if(pairs)
    {
        WACloudAccessToken* accessToken;
        accessToken = [[WACloudAccessToken alloc] initWithDictionary:pairs];
        [WACloudAccessControlClient setToken:accessToken];

        [self dismissModalViewControllerAnimated:YES];
    }

    return NO;
}

[NSURLConnection connectionWithRequest:request delegate:self];

return NO;

}

Any ideas?


回答1:


Seems like WACloudAccessControlClient is a class, not an instance variable in the code you wrote.

When you are calling something like [AClass someMethod], you are actually working with structure of AClass, not with an instance. Structure cannot save/store in memory any runtime data, because it doesn't have allocated memory.

If WACloudAccessControlClient is an instance variable in this code, then it's not imported with statement:

#import "WACloudAccessControlClient.h"

... or something similar to this. Compiler cannot detect any method declared with such signature. For more information about class methods read this.



来源:https://stackoverflow.com/questions/16231636/ios-wacloudaccesscontrolclient-may-not-respond-to-settoken

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!