#726: Methods added to String do not get added to all strings
---------------------------------+------------------------------------------
 Reporter:  dy...@…              |       Owner:  lsansone...@…        
     Type:  defect               |      Status:  new                  
 Priority:  blocker              |   Milestone:  MacRuby 0.6          
Component:  MacRuby              |    Keywords:                       
---------------------------------+------------------------------------------
 Methods added to the string class are not being added to the string
 returned from NSMutableString. I've also seen this with stringValue from
 NSTextFieldCell.

 The following will generate an error, even though the classes of the two
 objects are both 'String'.

 I'm not sure if this occurs with other open classes.

 {{{
 class String
   def cook
     puts 'Bacon!'
   end

   def to_mutable_attributed_string
     NSMutableAttributedString.alloc.initWithString( self )
   end
 end

 base_string = 'breakfast'

 puts base_string.class
 base_string.cook

 mutable = base_string.to_mutable_attributed_string

 puts mutable.string.class
 mutable.string.cook

 }}}

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

_______________________________________________
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel

Reply via email to