Send Message Method
BlitzMax Forums/BlitzMax Programming/Send Message Method
| ||
Objects have defined a method SendMessage:Object(message:Object, context:Object) and as all Types are derived from Object, every Type has this method, which by default simply returns Null. From an OO-theory point of view, I understand why it's there, but I am just wondering if anybody has ever actually made practical use of this method in their project? |
| ||
I know it's there, but I use my own messaging system for it. |
| ||
Czar, I don't really understand why it's there or how to use it. If you figure out how to use it, Do you mind posting a working example so I can try to understand it? I have wild guesses but it is really beyond my knowledge. |
| ||
I've used it for something similar to [a http://developer.apple.com/mac/library/documentation/cocoa/reference/Foundation/Protocols/NSObject_Protocol/Reference/NSObject.html#//apple_ref/occ/intfm/NSObject/performSelector:withObject:]NSObject performSelector:withObject:[/a]. It's handy when you don't know what the receiver actually does/handles and you need to send messages to differently-typed objects. |
| ||
Isn't SendMessage like an Objective-C thing? I am not very familiar with it. |