user2289669
user2289669

Reputation: 15

IOS - Request for member 'domain' not a structure or union?

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

Answers (1)

Tom van der Woerdt
Tom van der Woerdt

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

Related Questions