iOS-WACloudAccessControlClient可能不响应setToken? [英] ios - WACloudAccessControlClient may not respond to setToken?
问题描述
我正在尝试获取令牌,但收到类似'WACloudAccessControlClient的警告消息,可能无法响应setToken
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;
}
有什么想法吗?
推荐答案
似乎WACloudAccessControlClient是一个类,而不是您编写的代码中的实例变量。
Seems like WACloudAccessControlClient is a class, not an instance variable in the code you wrote.
在调用类似[AClass someMethod]之类的东西时,实际上是在使用AClass的结构,而不是实例。
结构无法将任何运行时数据保存/存储在内存中,因为它没有分配内存。
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.
如果WACloudAccessControlClient是此代码中的实例变量,则它不是用语句导入的:
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.
这篇关于iOS-WACloudAccessControlClient可能不响应setToken?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!