[MacRuby-devel] Calling Foundation functions
Игорь Владимирович Евсюков
igor.evsukov at gmail.com
Wed Nov 16 10:14:56 PST 2011
Hi Colin,
You have issues because NSLocalizedString isn't a C function, I'm not sure,
but I believe that it is preprocessor macros because it Xcode it
highlight's as a macros: http://cl.ly/Bqw9
On Wed, Nov 16, 2011 at 7:39 PM, Colin McPhail <mcphail_colin at hotmail.com>wrote:
> Hi,
>
> I'm having trouble calling the Foundation function NSLocalizedString from
> within a method I have added to class NSRunningApplication:
>
> class NSRunningApplication
> def activeString
> active? ? NSLocalizedString("Yes", "Yes") : NSLocalizedString("No",
> "No")
> end
> end
>
> The error message I get is:
> undefined method `NSLocalizedString' for
> #<NSKVONotifying_NSRunningApplication:0x40127e680> (NoMethodError)
>
> I can however successfully call NSLog, which is another Foundation
> function, from the same place.
>
> Is there a way I can call NSLocalizedString (and why is NSLog a special
> case)?
>
> Thanks for any info.
> -- Colin
> _______________________________________________
> MacRuby-devel mailing list
> MacRuby-devel at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-devel/attachments/20111116/0091aae8/attachment.html>
More information about the MacRuby-devel
mailing list