NSRange range = [[[NSHTTPCookie requestHeaderFieldsWithCookies:[[NSHTTPCookieStorage sharedHTTPCookieStorage] cookiesForURL:[NSURL URLWithString:cookie]]] objectForKey:@"Cookie"] rangeOfString:@"variable"];
if (range.length != NSNotFound) {
//it has data
} else {
//it doesn't
}
从我所能找到的资源来看,这个应该可以工作,但是它不能工作,即使cookie是空的。
我做错什么了?