需要帮助声明和实现带有块但没有参数的方法。听起来很简单,但我错过了一些东西,因为这有效:
- (void) RetrieveDevices: (NSInteger)count
success:(void (^)(NSMutableArray *devices))success
failure:(void (^)(aylaError *err))failure;
- (void)RetrieveDevices:(NSInteger)count
success:(void (^)(NSMutableArray *devices))successBlock
failure:(void (^)(aylaError *err))failureBlock
{
}
这不会编译,因为它需要一个方法体:
- (void) RetrieveDevices
success:(void (^)(NSMutableArray *devices))success
failure:(void (^)(aylaError *err))failure;
- (void)RetrieveDevices
success:(void (^)(NSMutableArray *devices))successBlock
failure:(void (^)(aylaError *err))failureBlock
{
}
感谢帮助。