-[NSHTTPCookieStorageInternal cookies]: unrecognized selector sent to instance 0x...

Getting a NSHTTPCookieManagerCookiesChangedNotification notification and I try to extract an array of cookies from storage as such:

NSHTTPCookieStorage *storage = notification.object;
NSArray *cookies = [storage cookies];


Line # 2 throws the -[NSHTTPCookieStorageInternal cookies]: unrecognized selector sent to instance 0x... error. Header file doesn't mention that the cookies method is deprecated in any way.

I inspected the list of publicly available methods in the NSHTTPCookieStorage and cookies is nowhere to be found:

  • dealloc
  • _initWithIdentifier:private:
  • _syncCookies
  • registerForPostingNotifications
  • initInternalWithCFStorage:


what am I missing here? Is it an issue with the NSHTTPCookieManagerCookiesChangedNotification mechanism? Why is it giving an object of type NSHTTPCookieStorageInternal instead of NSHTTPCookieStorage?

-[NSHTTPCookieStorageInternal cookies]: unrecognized selector sent to instance 0x...
 
 
Q