0

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?

Leo Chapiro
  • 13,678
  • 8
  • 61
  • 92

1 Answers1

0

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.

Community
  • 1
  • 1
art-divin
  • 1,635
  • 1
  • 20
  • 28