Calling NSGetCriticalAlertPanel

Wes Zuber
  • Wes Zuber

    Wes Zuber - 2002-06-06

    I have posted already on this but I just can't see any examples on this and I really don't know what is wrong.

    How does one call NSGetCriticalAlertPanel?

    If I use NSGetCriticalAlertPanel ("text1,"text2..
    I get a complaint about the argument not being of the type of NSString. How do I go about passing in the right stuff?

    Does anyone have any idea on how to do this?


    • Sherm Pendley

      Sherm Pendley - 2002-06-20

      It's a bug in CamelBones. Perl strings are automatically "promoted" to NSString objects in method calls, but not in function calls.

      For methods, the automatic promotion works both ways - NSString objects that are returned from method calls, or passed to Perl methods as arguments, are also automatically promoted to Perl strings.

      Unfortunately, this promotion magic makes life difficult if you need to create a real, honest-to-goodness NSString object to work with in Perl; you can't get a reference to an NSString object, because the return value of NSString->alloc->init, being an NSString object, is automatically promoted.

      That rules out the first workaround that comes to mind, which was to create NSString objects and pass them to the NSGetCriticalAlertPanel() function, instead of passing Perl strings.

      So, this really is *two* bugs. The first is that automatic string promotion is broken in function calls. The second is that automatic string promotion is broken with respect to init* methods, where it shouldn't be doing anything.


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks