On Jul 17, 2004, at 12:21 AM, Pierre Vaudrey wrote:

Alan,

Please find sherm's answer to a similar question :

Le samedi, 17 jul 2004, à 03:15 Europe/Paris, Alan Olsen a écrit :

Anyone have a good example of usage of NSString and/or NSRunPanelAlert?
D'oh! I thought I'd fixed that bug for good. Okay, I see what's causing it now, it'll be fixed in the next release.

Meanwhile, there's a work-around. When you need to pass an NSString to a function - just a function, object and class methods aren't affected by this - pass a reference. It can be a reference to an NSString object, or to an ordinary scalar. So the easiest thing is to simply put a backslash in front of your constant strings, like this:

NSRunAlertPanel(\"Warning!", \"Are you sure...?", \"OK", \"Cancel", \"");

Wow. That is the most non-obvious solution i have seen in a while.

It does work though.

Thanks.



Reply via email to