[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CFNotification problems



Hi !

I have some odd problems with CFNotifications.
The fact is that I upgraded OS X PB with the October release and since that I get problems with notifications...

The notification appears great the first time, and subsequent notifications do not appear anymore. More embarrassing, once I got the problem with the notification, the process window (option-command-esc) won't show up anymore ! And I have to reboot...
This worked great with the first release of OS X PB.

Ideas of what's going on ?

Thanks,

Raphael

Here is the code creating the notifications :

in a .m file, those funcs are called from cpp (in a framework)
-------------------------------

#import <Foundation/Foundation.h>

void ShowMessage(const char *msg)
{
    CFOptionFlags responseFlags;
    CFStringRef message;
    
    message = CFStringCreateWithCString(NULL, msg, CFStringGetSystemEncoding());
    
    CFUserNotificationDisplayAlert(0, 0, 0, 0, 0, (CFStringRef)@"bla", message, (CFStringRef)@"OK", NULL, NULL, 
        &responseFlags);
    
    CFRelease(message);
}
 
void ShowEvalMessage()
{
    CFOptionFlags responseFlags;
    CFStringRef message;
    
    message = CFSTR("blabla");
   
    CFUserNotificationDisplayAlert(0, 0, 0, 0, 0, (CFStringRef)@"bla", message, (CFStringRef)@"OK", NULL, NULL, 
        &responseFlags);
        
    CFRelease(message);
}