我有一个对象链。存在链上的对象以很好地划分功能。完成块向上传递,我想如果另一个对象想向完成块添加东西,我可以将完成块包装在相同类型的块中,调用第一个块,一切都会是 ace。我得到 EXC_BAD_ACCESS。我的语法是错误的还是我完全以错误的方式处理这个问题?
-(void)archiveChatWithDictionary:(NSDictionary*)dictionary andCompletionBlock:(ServerConnectionCompletionBlock)completionBlock
{
ServerConnectionCompletionBlock localCompletionBlock = ^(ServerConnection *connection, NSError *error) {
// Do some stuff
// ...
// This line produces EXC_BAD_ACCESS
completionBlock(connection, error);
};
[self.chatEndpointInterface archiveChatWithDictionary: dictionary andCompletionBlock: localCompletionBlock];
}