我正在尝试从 cookie 中获取令牌。当我这样做时,我收到如下错误:
“请求成员‘域’不是结构或联合”
- (NSString*)getTokenFromCookie {
NSHTTPCookie *cookie;
NSHTTPCookieStorage *cookieJar = [NSHTTPCookieStorage sharedHTTPCookieStorage];
for (cookie in [cookieJar cookies]) {
if ([[cookie domain] isEqualToString:self.domain]) {
if ([[cookie name] isEqualToString:@"oauth_token"]) {
return [cookie value];
}
}
}
return nil;
}