this should work, you can still use enumerateIndexesUsingBlock!
framework 'Foundation'
class NSIndexSet
def each
return self.to_enum unless block_given?
self.enumerateIndexesUsingBlock -> idx, stop { yield idx }
end
end
indexes = NSIndexSet.indexSetWithIndexesInRange NSMakeRange(0,
Thank you! I promise to do a better search before I ask any more questions.
On 16 Nov 2011, at 19:25, Mateus Armando wrote:
> It’s a macro and I solved this problem like this:
>
> module Kernel
> private
>
> def NSLocalizedString(key, value)
> NSBundle.mainBundle.localizedStringForKey(
On 17/11/2011, at 4:07 AM, Daniel Westendorf wrote:
> Give it some ruby love! I found this somewhere in the interwebs to iterate
> over an NSIndexSet, which should be similar. https://gist.github.com/1370277
And while you're at it, check out Bean...
https://github.com/dj2/Bean
Lots more helpf
It’s a macro and I solved this problem like this:
module Kernel
private
def NSLocalizedString(key, value)
NSBundle.mainBundle.localizedStringForKey(key, value:value, table:nil)
end
end
this question has already been
here:
http://lists.macosforge.org/pipermail/macruby-devel/2011-Febr
Hi Igor,
You are right, NSLocalizedString is a macro. I never thought of that!
Thank you.
-- Colin
On 16 Nov 2011, at 18:14, Игорь Владимирович Евсюков wrote:
> Hi Colin,
>
> You have issues because NSLocalizedString isn't a C function, I'm not sure,
> but I believe that it is preprocessor m
This and many other great examples of "how to do FOO in MacRuby" lead me to
wonder whether the wiki (or any wiki) is really being used to its fullest?
Some real gems (no pun intended) have gone by, and it would be awesome for
newcomers to have a place to go where they can explore a variety of
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 wrote:
> Hi,
>
> I'm having trouble calling the Foundat
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
Hi Jean-Denis,
I can't answer your question directly but I may be able to help a bit. I also
want to use mysql with `MacRuby. I tried mysql gem version 2.8.1 and hit
problems I couldn't work around. I also tried ruby-mysql 2.9.4. I did get
that to work after some mods, but it was very slow t
Hi,
I have a big showstopper with my app: sequel with the mysql gem fails with the
following error message:
dyld: Symbol not found: _rb_str_freeze
Referenced from: /Library/Frameworks/MacRuby.frameword/[…]/mysql_api.bundle
This is mentioned on the net on the sequel project back in february. The
Give it some ruby love! I found this somewhere in the interwebs to iterate
over an NSIndexSet, which should be similar. https://gist.github.com/1370277
dw
On Wed, Nov 16, 2011 at 3:11 AM, Jean-Denis MUYS wrote:
> I have this ordered Core Data to-many relation named "operations" that I
> want to
I have this ordered Core Data to-many relation named "operations" that I want
to iterate over. I wrote:
self.operations.each { | operation | operation.doSomething }
However this fails because self.operations returns an NSOrderedSet and
NSOrderedSet doesn't have an 'each' method.
I was able
12 matches
Mail list logo