Thanks I will have a look.
Esteban my point is that it looks like delegates are like strategy but I
wonder why all the strategies for a given facet
would not have to implement the protocol. To me having isKindOf:
respondTo: sucks so when a framework forces it
this is even worse.
Stef
On 16/7/14 11:04, Esteban Lorenzano wrote:
btw… while I think cocoa fundamentals is good reading, it is marked as
a retired document.
I think the replace doc is this one:
https://developer.apple.com/library/mac/documentation/general/conceptual/CocoaEncyclopedia/CocoaEncyclopedia.pdf
(but since I still do not read it, I don’t know if is a good replacement)
Esteban
On 16 Jul 2014, at 10:58, stepharo <[email protected]> wrote:
I found strange to force user to write
Before invoking a delegation method, make sure the delegate
implements it by sending it a
respondsToSelector: message.
Cocoa Fundamentals Guide (TP40002974 6.0.0)
- (void)someMethod {
if ( [delegate respondsToSelector:@selector(operationShouldProceed)] ){
if ( [delegate operationShouldProceed] ) {
// do something appropriate
} }
}
I'm reading also on bindings (could be like valueHolder) and
targetAction.
I think that I will have to read that several times :)
https://developer.apple.com/legacy/library/documentation/Cocoa/Conceptual/CocoaFundamentals/CocoaFundamentals.pdf
Stef
Cocoa Fundamentals Guide (TP40002974 6.0.0)
On 16/7/14 10:48, stepharo wrote:
Hi
In the quest for a better UI framework :), I was re rereading about
delegate in Cocoa.
A delegating object will delegate certain operations to a delegate
object (check the attachment).
Now I was wondering why this is not a simple delegation they wrote:
The delegating object sends a message only if the delegate
implements the method. It makes this discovery by invoking the
NSObject method respondsToSelector: in the delegate first.
Cocoa Fundamentals Guide (TP40002974 6.0.0)