Commit d402958e authored by zyy's avatar zyy

添加强引用,以免对象被释放掉所带来的异常

parent e70691b7
......@@ -213,9 +213,11 @@
previewVc.currentIndex = index;
__weak typeof(self) weakSelf = self;
[previewVc setDoneButtonClickBlockWithPreviewType:^(NSArray<UIImage *> *photos, NSArray *assets, BOOL isSelectOriginalPhoto) {
[weakSelf dismissViewControllerAnimated:YES completion:^{
if (weakSelf.didFinishPickingPhotosHandle) {
weakSelf.didFinishPickingPhotosHandle(photos,assets,isSelectOriginalPhoto);
__strong typeof(weakSelf) strongSelf = weakSelf;
[strongSelf dismissViewControllerAnimated:YES completion:^{
if (!strongSelf) return;
if (strongSelf.didFinishPickingPhotosHandle) {
strongSelf.didFinishPickingPhotosHandle(photos,assets,isSelectOriginalPhoto);
}
}];
}];
......@@ -238,7 +240,8 @@
previewVc.currentIndex = 0;
__weak typeof(self) weakSelf = self;
[previewVc setDoneButtonClickBlockCropMode:^(UIImage *cropImage, id asset) {
[weakSelf dismissViewControllerAnimated:YES completion:^{
__strong typeof(weakSelf) strongSelf = weakSelf;
[strongSelf dismissViewControllerAnimated:YES completion:^{
if (completion) {
completion(cropImage,asset);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment