🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Yufeng Tsui Thu, 20 Jul 1989 04:22
respondsTo
#1
Author: Yufeng Tsui
Date: Thu, 20 Jul 1989 04:22
58 lines
1621 bytes
Now here is something I can not figure out why, can anyone enlighten me please?

I defined a class:

@implementation MyMatrix: Matrix
{
...
}

+newFrame:aFrame
{
  ...
}

-cellPressed:sender
{

 ....
}

-deleteSelf:sender
{

}

@end

In some other place I have the following code:

myMatrix = [MyMatrix newFrame:&aframe];
...
if ([myMatrix respondsTo:@selector(cellPressed:)]) {
 ...
}
if ([myMatrix respondsTo:@selector(deleteSelf:)]) {
 ...
}
 
...


Then I found myMatrix responds to cellPressed: but does not respond to 
deleteSelf.

I did not understand why and I switched the place of cellPressed: and
deleteSelf: in the implementation of MyMatrix.  Now the above piece
of code says myMatrix only responds to deleteSelf:, not to cellPressed:
It seems like it only responds to the first method defined.  Now what is
going on? What am I missing?  BTW, I set the target of myMatrix to itself.
IS it allowed?  Thanks

--yufeng
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Yufeng Tsui, IU.   HOME OF HOOSIERS	          
{ihnp4!inuxc,rutgers,pyramid}!iuvax!silver!tsui	  
tsui@silver.bacs.indiana.edu (192.12.206.2)	  
tsuiy@iubacs.bitnet (forwarded)			  
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads