[MacRuby-devel] Calling Foundation functions

Colin McPhail mcphail_colin at hotmail.com
Wed Nov 16 09:39:03 PST 2011


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


More information about the MacRuby-devel mailing list