• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Attack of the Nils!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Attack of the Nils!


  • Subject: Re: Attack of the Nils!
  • From: mw <email@hidden>
  • Date: Tue, 31 Dec 2002 15:46:04 -0500

On 12/30/02 5:51 PM, "Marcel Weiher" <email@hidden> wrote:

>> and neither method has any private variables that have the name
>> 'controller'. However, I did test your theory, and the pointer was
>> still
>> <nil> when it got to -mouseExit. Any other ideas?
>
> 1. Make sure that 'self' is the same object in both cases, by
> printing its address.
> 2. Don't use the debugger to check these things, use NSLog()
>

Ah hah! That was the problem! The memory address of self was different in
the two cases. Upon further inspection, I found out that, even though the
rollover button object was contained in the nib file (and therefore had
already been allocated and initialized), I was creating ANOTHER instance of
the class in my code. The first time execution was given to a method in the
class, it was in the -awakeFromNib method (in the instance of the class in
the nib file). The second time, it was its own method, so it was in the one
I created. With this knowledge, I defeated the problem :-).

Thanks for everyone's help! It seems that a lot of you were hinting towards
a dual instance of the class.

Thanks again,
mw
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Attack of the Nils! (From: Marcel Weiher <email@hidden>)

  • Prev by Date: Re: Dynamic color changes in a text view
  • Next by Date: Re: Dynamic color changes in a text view
  • Previous by thread: Re: Attack of the Nils!
  • Next by thread: Re: Attack of the Nils!
  • Index(es):
    • Date
    • Thread