在iOS 中创建自定义Delegates properties with ARC错误的解决方法


错误提示:error: Automatic Reference Counting Issue: Existing ivar 'delegate' forunsafe_unretained property 'delegate' must be __unsafe_unretained



解决方法:
将原来的:

@interface CustomeView : UIViewController

{

    id <CustomeDelegate> delegate;

}

@property (nonatomic, assignid <CustomeDelegate> delegate;


修改为:

 

 

@interface CustomeView : UIViewController

{

    __unsafe_unretained id <CustomeDelegate > delegate;

}

@property (nonatomic, assign) id <CustomeDelegate> delegate;


你可能感兴趣的:(在iOS 中创建自定义Delegates properties with ARC错误的解决方法)