[Rubycocoa-devel 988] Re: NSPoint.clone causes weird behavior

Back to archive index

Laurent Sansonetti laure****@gmail*****
Fri Jun 15 10:40:18 JST 2007


Hi Tatsuhiro-san,

Recently in SVN I introduced the #dup method which should do what you want.

I wasn't aware of #clone but apparently it does the same thing than
#dup. We may alias our #dup to #clone too.

Laurent

On 6/14/07, Tatsuhiro Nishioka <tat****@ics*****> wrote:
> Hi folks,
>
> I've been working on adapting MiniKidsGames/FlightGear Mac OS X to
> RubyCocoa-0.11.1 (was working on 0.5.0)
> It seems that almost everything works perfectly after eliminating
> deprecated stuff.
> However, there's a tiny problem that I want to share with you guys.
>
> Here is the simple code that causes the exception "Given structure
> 0x4b83fc has null data." on 0.11.1
>
> point1 = NSPoint.new(10, 20);
> point2 = point1.clone
>
> if (point2.y < 100) # This doesn't raise exception
>    point2.y += 10    # Exception occurs here, in this case point2 is
> 0x4b83fc
> end
>
> I think it's a bit weird since referring to point2.y is OK but
> assigning value is not.
>
> This means that it's better not use a clone of NSPoint (or any
> instance of NSObject?)
> Plus, this code works on RubyCocoa-0.5.0. (I only tested this on
> 0.5.0 and 0.11.1)
> Does any of you knows what causes this? Or using clone for NSObject
> is no good at all?
>
> Anyways, your effort and progress on RubyCocoa is wonderful.
> I really appreciate your doing this for many ruby/cocoa users.
>
> Thanks
>
> p.s.
> How was the WWDC, Hisa-san?
> I really like the message on your bag so I'd like to know that.
>
> Tat
>
> -------------------------------------------
> Tatsuhiro Nishioka
>
> Institute for Software Research,
> University of California, Irvine
> email: tat****@ics*****
> voice: 944-824-2703
> -------------------------------------------
>
> _______________________________________________
> Rubycocoa-devel mailing list
> Rubyc****@lists*****
> http://lists.sourceforge.jp/mailman/listinfo/rubycocoa-devel
>




More information about the Rubycocoa-devel mailing list
Back to archive index