[MacRuby] #1044: Iteration of NSDictionary returns Array instead of NSDictionary

MacRuby ruby-noreply at macosforge.org
Tue Dec 14 20:15:21 PST 2010


#1044: Iteration of NSDictionary returns Array instead of NSDictionary
--------------------------------+-------------------------------------------
 Reporter:  ksandvik@…          |        Owner:  lsansonetti@…        
     Type:  defect              |       Status:  closed               
 Priority:  critical            |    Milestone:                       
Component:  MacRuby             |   Resolution:  invalid              
 Keywords:  NSDictionary        |  
--------------------------------+-------------------------------------------
Changes (by lsansonetti@…):

  * status:  new => closed
  * resolution:  => invalid
  * milestone:  MacRuby 0.8 =>


Comment:

 It looks like it's behaving as expected.

 The key "Master Image List" points to a dictionary.

 You're calling #each on it, which means it will yield an array of 2
 elements (key and value) each time.

 Maybe you want to try the following instead?

 {{{
 masterImageDict.each do |key, entry|
         puts entry.class
 end
 }}}

-- 
Ticket URL: <http://www.macruby.org/trac/ticket/1044#comment:1>
MacRuby <http://macruby.org/>



More information about the macruby-tickets mailing list