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
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
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
{
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
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
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,
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