Reputation: 15
I'm trying to get token from cookie. When I do I get an error like:
"Request for member 'domain' not a structure or union"
- (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;
}
Upvotes: 0
Views: 115
Reputation: 29975
This happens because of self.domain
You probably haven't declared it as an @property
, or self
is not what you think it is.
Upvotes: 3