[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: One Question

From: Richard Frith-Macdonald
Subject: Re: One Question
Date: Thu, 26 Apr 2001 20:10:51 +0100

On Thursday, April 26, 2001, at 07:31 PM, YJCHEN wrote:

  Sorry for misleading.
  I set Black as a Instance Method.
  I put the source code in:
  You can just check the Red methond in AppDelegate.m
  and Black method in ImageWindow.m

  I use AppDelegate to create a instance of ImageWindow,
  then use ImageWindow *keyWin = [NSApp keyWindow]
  to get the key instance of ImageWindow.

But how do you know that the window being returned by keyWindow is
your ImageWindow instance?  It might not be, and your code doesn't

In fact, looking at your code, I can see that your image window is
never ordered in, and so could not become a key window, while its
createWindow method actually creates and orders in a normal NSWindow
instance ... which is presumably what you end up sending the
'black' message to.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]