[MacRuby-devel] Key-Value Compliance & valueForKey:

Joshua Ballanco jballanc at gmail.com
Thu Dec 22 07:49:11 PST 2011


Hey Patrick,

Just wanted to follow up on this…did you manage to resolve the issue? If not, could you make sure you log this bug with Trac (https://www.macruby.org/trac/report)?

Thanks!

- Josh  


On Thursday, November 17, 2011 at 3:44 PM, Patrick Rogers wrote:

> Hi everyone,
>  
> I'm trying to automatically generate the KVC-compliant methods for indexed to-many relationships.   
>  
> Here's my current attempt, https://gist.github.com/1374142, which borrows from hotcocoa's kvo_array (I couldn't get `kvo_array` to work and I wanted something that could just automatically be backed by an Array).
>  
> Anyways, countOf<Key> and objectIn<Key>AtIndex: are both generated and work.
>  
> However, when I try and use valueForKey(<key>) on my generated keys, MacRuby crashes with:
>  
> > unknown: [BUG] unknown Objective-C immediate: 0x1 (nil)
> >  
> > MacRuby 0.11 (ruby 1.9.2) [universal-darwin10.0, x86_64]
> >  
> > [1]    26123 abort      macruby kvo_array.rb
>  
> It is my understanding this should return an array based on my countOf<Key> and objectIn<Key>AtIndex: methods.
>  
> On the other hand, when I use the manually defined methods, valueForKey(...) works as expected.
>  
> Is there an issue with my code/approach or is this a MacRuby bug?
>  
> Thanks,
> Patrick
> _______________________________________________
> MacRuby-devel mailing list
> MacRuby-devel at lists.macosforge.org (mailto: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/20111222/ece1230d/attachment-0001.html>


More information about the MacRuby-devel mailing list