[MacRuby] #1066: TableView bug?

MacRuby ruby-noreply at macosforge.org
Mon Dec 20 07:52:44 PST 2010


#1066: TableView bug?
----------------------------------+-----------------------------------------
 Reporter:  yasuimao@…            |       Owner:  lsansonetti@…        
     Type:  defect                |      Status:  new                  
 Priority:  blocker               |   Milestone:                       
Component:  MacRuby               |    Keywords:                       
----------------------------------+-----------------------------------------
 There seems to be a bug with NSTableView
 (tableView:willDisplayCell:forTableColumn:row:).

 Attached are two test programs (one working and one not working).

 The script is following (identifiers of two columns are "0" and "1"):
 {{{
 class AppController

   attr_accessor :table

   def awakeFromNib
     @ary = []
   end

   def buttonPushed(sender)
     @ary = [[0,1],[2,3],[4,5]]
     @table.reloadData
   end

   def numberOfRowsInTableView(tableView)
     @ary.length
   end

   def tableView(tableView,objectValueForTableColumn:col,row:row)
     @ary[row][col.identifier.to_i]
   end

   def tableView(table, willDisplayCell: cell, forTableColumn: col, row:
 row)
     p row
   end
 end
 }}}

 By clicking a button, the table should display numbers, but it crashed.
 If you check Console, it returned 'nil' for 'row' and then crashed with
 "EXC_BAD_ACCESS".  For col, it returned NSTableColumn object.

 I'm not sure if there is something wrong with my script, though.

-- 
Ticket URL: <http://www.macruby.org/trac/ticket/1066>
MacRuby <http://macruby.org/>



More information about the macruby-tickets mailing list