CreateObjcInformalDelegateWithContext | ||||||||||
Type | handler | |||||||||
Dictionary | LCB | |||||||||
Library | LiveCode Builder | |||||||||
Syntax |
| |||||||||
Associations | com.livecode.objc | |||||||||
Summary | Create an Objective-C object with LCB implementations of methods of an informal protocol. | |||||||||
Parameters |
| |||||||||
Example |
| |||||||||
Values |
| |||||||||
Related | Handler: CreateObjcDelegate, CreateObjcDelegateWithContext, CreateObjcInformalDelegate | |||||||||
Description | Use the CreateObjcInformalDelegateWithContext handler to create instances of Objective-C delegate classes with LCB implementations of protocol methods, when the Protocol object cannot be found at runtime. This occurs for example when all of the protocol methods are optional. Instead of a protocol name (as with CreateObjcDelegateWithContext), the pProtocol argument of CreateObjcInformalDelegateWithContext must be a proper list of foreign handlers for each of the methods of the protocol for which LCB callbacks are provided in the pHandlerMapping array. Once created an informal delegate can be set in the usual way on an
instance of the appropriate class (by binding to If no context is required to be passed as a parameter to the callback, use CreateObjcInformalDelegate. If the protocol can be resolved at runtime, it is generally easier to use the CreateObjcDelegateWithContext handler. |