iOS 5 bloques ARC puente puente
Esta pregunta hace referencia a esta pregunta:¿Cómo simplificar la lógica de devolución de llamada con un bloque?
Mi encabezado tiene estos typedefs
typedef void (^StuffDoneBlock)(NSDictionary * parsedData);
typedef void (^StuffFailedBlock)(NSError * error);
Y en init
stuffDoneCallback = Block_copy(done);
StuffFailedCallback = Block_copy(error);
En este documento, dice que Block_copy es innecesario. Pero luego necesita un molde en puente. El mensaje del compilador es el siguiente:
error: cast of block pointer type 'StuffDoneBlock' (aka 'void (^)(NSDictionary *__strong)') to C pointer type 'const void *' requires a bridged cast [4]
stuffDoneCallback = _bridge(Block_copy(done));
^~~~~~~~~~~~~~~~
/Developer-4.2/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/usr/include/Block.h:60:61: note: instantiated from:
#define Block_copy(...) ((__typeof(__VA_ARGS__))_Block_copy((const void *)(__VA_ARGS__)))
^~~~~~~~~~~~~~~~~~~~~~~~~~~