• iOS block第二弹


    对于多重block防止重复引用的方法

      __weak typeof(self) weakSelf = self;

    [_moreActionSheet showFNActionSheetWithCompletionHandler:^(NSInteger buttonIndex) {
           if (buttonIndex == 1) {
                //发送消息
                [FNAlertHelper showAlertWithTitle:item.content msg:@"" chooseBlock:^(NSInteger buttonIdx) {
                    __strong typeof(weakSelf) strongSelf = weakSelf;
                    if (buttonIdx == 1) {
                        [strongSelf showMessageView:[NSArray arrayWithObjects:item.content, nil] title:@"" body:@""];
                    }
                } buttonsStatement:@"取消", @"发短信", nil];
                
            } else if (buttonIndex == 2) {
                // 复制
                UIPasteboard *pboard = [UIPasteboard generalPasteboard];
                pboard.string = item.content;
                [weakSelf.view makeToast:@"复制成功" duration:2 position:CSToastPositionCenter];
            }
        }];
  • 相关阅读:
    JS函数式编程【译】前言
    11.15周总结
    11.13
    11.12
    11.11
    11.10
    11.9
    11.8周总结
    11.6
    11.5
  • 原文地址:https://www.cnblogs.com/qiyiyifan/p/8602358.html
Copyright © 2020-2023  润新知