运行块时Xcode 9崩溃了

时间:2017-09-25 07:44:59

标签: ios block xcode9

如果我通过Xcode 8安装应用程序它运行良好,但是当我通过Xcode 9安装应用程序时它崩溃了,请按照我的代码进行操作:

首先是头文件

@interface EGCAction : NSObject

+ (instancetype )actionWithTitle:(NSString *)title
                         handler:(void(^)())handler
                           style:(EGCActionStyle)style;


@property (nonatomic, copy  )NSString       *title;
@property (nonatomic, assign)EGCActionStyle style;
@property (nonatomic, copy  )void(^handler)();

@end

我得到一个动作数组并按如下方式运行代码:

EGCAction *action = self.actions[index];

if (action.handler) {

    action.handler();
}

EGCAction是一个类,处理程序是一个blcok属性,

enter image description here

有没有人可以帮助我?非常感谢!

0 个答案:

没有答案