Re: question about informal protocols

2009-11-22 Thread Henry McGilton (Boulevardier)
On Nov 20, 2009, at 12:22 PM, Jens Alfke wrote: On Nov 20, 2009, at 12:09 PM, Michael de Haan wrote: Does the, in your opinion, optional addition pretty much replace categories as a whole, or is there still a role for them? It replaces informal protocols. There are many other uses for

question about informal protocols

2009-11-20 Thread Michael de Haan
I am working through an example in Buck/Yacktman's book that uses an informal protocol. In the interface of of a custom class, it is declared as such. #import Cocoa/Cocoa.h @interface MyShapeEditorDocument : NSDocument { ivars } @end @interface

Re: question about informal protocols

2009-11-20 Thread Jean-Daniel Dupas
Le 20 nov. 2009 à 20:46, Michael de Haan a écrit : I am working through an example in Buck/Yacktman's book that uses an informal protocol. In the interface of of a custom class, it is declared as such. #import Cocoa/Cocoa.h @interface MyShapeEditorDocument : NSDocument {

Re: question about informal protocols

2009-11-20 Thread Michael de Haan
The usual way is to NOT implements the NSObject category and test if the delegate implements the method using -respondsToSelector: But this way works too if you don't want to have to test before sending your message. Anyway, informal protocols are deprecated in favor of @protocol with

Re: question about informal protocols

2009-11-20 Thread David Duncan
On Nov 20, 2009, at 12:09 PM, Michael de Haan wrote: Did not see that it was deprecated, but will take your lead and convert them to that. Does the, in your opinion, optional addition pretty much replace categories as a whole, or is there still a role for them? The addition of @optional

Re: question about informal protocols

2009-11-20 Thread Jean-Daniel Dupas
Le 20 nov. 2009 à 21:09, Michael de Haan a écrit : The usual way is to NOT implements the NSObject category and test if the delegate implements the method using -respondsToSelector: But this way works too if you don't want to have to test before sending your message. Anyway,

Re: question about informal protocols

2009-11-20 Thread Michael de Haan
On Nov 20, 2009, at 12:19 PM, David Duncan wrote: On Nov 20, 2009, at 12:09 PM, Michael de Haan wrote: Did not see that it was deprecated, but will take your lead and convert them to that. Does the, in your opinion, optional addition pretty much replace categories as a whole, or is there