WebKit and Notification trouble
-
Hi,
After updating some Cookie informations with NSHTTPCookieStorage, I
try to send a notification to inform the webkit.
My code is :
#import <Foundation/NSHTTPCookieStorage.h>
...
[[NSNotificationCenter defaultCenter]
postNotification:NSHTTPCookieStorageCookiesChangedNotification];
..
but i've got an error at compile time :
'NSHTTPCookieStorageCookiesChangedNotification' undeclared (first use
in this function)
What is the good way to inform the Webkit of the cookie changes ?
Thanks
Xavier -
On Tuesday, August 12, 2003, at 12:27 PM, Xavier Pechoultres wrote:
> but i've got an error at compile time :
> 'NSHTTPCookieStorageCookiesChangedNotification' undeclared (first use
> in this function)
> What is the good way to inform the Webkit of the cookie changes ?
Did you mean to use NSHTTPCookieManagerCookiesChangedNotification?
- Scott
--
Tree House Ideas
http://treehouseideas.com/ -
Le mardi, 12 aoû 2003, à 21:51 Europe/Paris, Scott Stevenson a écrit :
>
> On Tuesday, August 12, 2003, at 12:27 PM, Xavier Pechoultres wrote:
>
>> but i've got an error at compile time :
>> 'NSHTTPCookieStorageCookiesChangedNotification' undeclared (first use
>> in this function)
>> What is the good way to inform the Webkit of the cookie changes ?
>
> Did you mean to use NSHTTPCookieManagerCookiesChangedNotification?
>
Yes, how to use NSHTTPCookieManagerCookiesChangedNotification ?
Xavier -
On Tuesday, August 12, 2003, at 12:58 PM, Xavier Pechoultres wrote:
>>> but i've got an error at compile time :
>>> 'NSHTTPCookieStorageCookiesChangedNotification' undeclared (first
>>> use in this function)
>>> What is the good way to inform the Webkit of the cookie changes ?
>>
>> Did you mean to use NSHTTPCookieManagerCookiesChangedNotification?
>
> Yes, how to use NSHTTPCookieManagerCookiesChangedNotification ?
The same way you attempted to post the other notification. I think you
had the right idea, just had the wrong notification name.
If you need more general info on notifications:
http://cocoadevcentral.com/articles/000029.php
http://developer.apple.com/documentation/Cocoa/Conceptual/
Notifications/Tasks/Posting.html
Best Regards,
- Scott
--
Tree House Ideas
http://treehouseideas.com/ -
Le mardi, 12 aoû 2003, à 22:34 Europe/Paris, Scott Stevenson a écrit :
>
> On Tuesday, August 12, 2003, at 12:58 PM, Xavier Pechoultres wrote:
>
>>>> but i've got an error at compile time :
>>>> 'NSHTTPCookieStorageCookiesChangedNotification' undeclared (first
>>>> use in this function)
>>>> What is the good way to inform the Webkit of the cookie changes ?
>>>
>>> Did you mean to use NSHTTPCookieManagerCookiesChangedNotification?
>>
>> Yes, how to use NSHTTPCookieManagerCookiesChangedNotification ?
>
>
> The same way you attempted to post the other notification. I think you
> had the right idea, just had the wrong notification name.
>
>
> If you need more general info on notifications:
>
> http://cocoadevcentral.com/articles/000029.php
> http://developer.apple.com/documentation/Cocoa/Conceptual/
> Notifications/Tasks/Posting.html
>
>
> Best Regards,
I must be crazy !! After many try, I cannot set a cookie. My code is :
NSHTTPCookie *cook; // cookie ptr
// instantiate the cookie
cook = [NSHTTPCookie cookieWithProperties:
[NSDictionary dictionaryWithObjectsAndKeys:
NSHTTPCookieOriginURL, @"zizou.local",
NSHTTPCookieValue, @"VALUE_TEST",
NSHTTPCookieName, @"COOKIE_NAME",
nil]];
// set the cookie in the Shared Cookie Manager
[[NSHTTPCookieStorage sharedHTTPCookieStorage]
setCookie:cook];
// post the notification to inform the WebKit and Other Applications
[[NSNotificationCenter defaultCenter]
postNotificationName:NSHTTPCookieManagerCookiesChangedNotification
object:nil];
After that, I open a WebView to the url and I check the cookies ( a php
file). My cookies is not sent and it does not appear in the Safari
cookies manager.
What's wrong ! :(
Regards
Xavier -
I don't have an answer for you, but there's an Apple-hosted public
mailing list for the WebKit SDK - go to lists.apple.com and look for
the list webkitsdk-dev. I'm pretty sure the folks on that list will be
able to help you out.
REW
On Sep 2, 2003, at 11:38 AM, Xavier Pechoultres wrote:
>
> Le mardi, 12 aoû 2003, à 22:34 Europe/Paris, Scott Stevenson a écrit :
>
>>
>> On Tuesday, August 12, 2003, at 12:58 PM, Xavier Pechoultres wrote:
>>
>>>>> but i've got an error at compile time :
>>>>> 'NSHTTPCookieStorageCookiesChangedNotification' undeclared (first
>>>>> use in this function)
>>>>> What is the good way to inform the Webkit of the cookie changes ?
>>>>
>>>> Did you mean to use NSHTTPCookieManagerCookiesChangedNotification?
>>>
>>> Yes, how to use NSHTTPCookieManagerCookiesChangedNotification ?
>>
>>
>> The same way you attempted to post the other notification. I think
>> you had the right idea, just had the wrong notification name.
>>
>>
>> If you need more general info on notifications:
>>
>> http://cocoadevcentral.com/articles/000029.php
>> http://developer.apple.com/documentation/Cocoa/Conceptual/
>> Notifications/Tasks/Posting.html
>>
>>
>> Best Regards,
>
> I must be crazy !! After many try, I cannot set a cookie. My code is :
>
> NSHTTPCookie *cook; // cookie ptr
>
> // instantiate the cookie
> cook = [NSHTTPCookie cookieWithProperties:
> [NSDictionary dictionaryWithObjectsAndKeys:
> NSHTTPCookieOriginURL, @"zizou.local",
> NSHTTPCookieValue, @"VALUE_TEST",
> NSHTTPCookieName, @"COOKIE_NAME",
> nil]];
>
> // set the cookie in the Shared Cookie Manager
> [[NSHTTPCookieStorage sharedHTTPCookieStorage]
> setCookie:cook];
>
> // post the notification to inform the WebKit and Other Applications
> [[NSNotificationCenter defaultCenter]
> postNotificationName:NSHTTPCookieManagerCookiesChangedNotification
> object:nil];
>
>
> After that, I open a WebView to the url and I check the cookies ( a
> php file). My cookies is not sent and it does not appear in the Safari
> cookies manager.
>
> What's wrong ! :(
>
> Regards
>
> Xavier
>
> _______________________________________________
> MacOSX-dev mailing list
> <MacOSX-dev...>
> http://www.omnigroup.com/mailman/listinfo/macosx-dev



