EXC_BAD_ACCESS invoking a block

后端 未结 2 517
既然无缘
既然无缘 2021-01-14 03:37

UPDATE | I\'ve uploaded a sample project using the panel and crashing here: http://w3style.co.uk/~d11wtq/BlocksCrash.tar.gz (I know the \"Choose...\" button does nothing, I\

2条回答
  •  温柔的废话
    2021-01-14 04:16

    Try defining your EDNewFilePanel with the __block modifier:

    __block EDNewFilePanel *newFilePanel = [EDNewFilePanel newFilePanel];
    

    This should retain the object when the block is called, which may be after the Panel object is released. As an unrelated side-effect, this will make also make it mutable within the block scope.

提交回复
热议问题