Re: Solved: NSHTTPCookieManagerCookiesChangedNotification
Re: Solved: NSHTTPCookieManagerCookiesChangedNotification
- Subject: Re: Solved: NSHTTPCookieManagerCookiesChangedNotification
- From: Jerry Krinock <email@hidden>
- Date: Tue, 27 Mar 2007 06:53:35 -0700
I take back all the bad things I said about
NSHTTPCookieManagerCookiesChangedNotification yesterday. You have to
wait a few seconds, and then run my app's run loop, but it does
eventually seem to work.
On 2007 Mar, 26, at 21:27, Jerry Krinock wrote:
According to the documentation,
NSHTTPCookieManagerCookiesChangedNotification "can be sent in
response to another application’s actions".
That's what I need, but unfortunately, although my app can get and
NSLog this notification when itself changes a cookie, nothing
happens when Safari changes a cookie.
Another programmer [1] has speculated that an app doesn't receive
this notification when it's not the active app, which of course
makes it rather difficult to be notified "in response to another
application's actions", as documented!
Has anyone gotten an NSHTTPCookieManagerCookiesChangedNotification
"in response to another application's actions"?
In general, apps receive notifications when they're not active,
don't they? I know I have an app which receives other system
notifications. Any ideas why this might not be working?
Jerry Krinock
[1] http://www.cocoabuilder.com/archive/message/cocoa/2005/7/1/140574
@implementation ApplicationController
- (void)clearLoggedInAccount:(NSNotification*)notification {
NSLog(@"10354 Somebody ate or puked a cookie!") ;
}
...
- (void)applicationDidFinishLaunching:(NSNotification *)note {
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(clearLoggedInAccount:)
name:NSHTTPCookieManagerCookiesChangedNotification
object:nil] ;
...
@end
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden