您的位置:首页 > 移动开发 > Objective-C

ARC forbids Objective-C objects in structs or unions

2017-07-22 16:43 330 查看
解决方法有二种:

1。在出错的地方加入
__unsafe_unretained


2。关闭系统ARC。1.点击project 2.点击Build
Setting 3.找到其以下的Objetive-C Automatic Reference Counting 改后面的YES为NO 即可了

转载:http://linuxp.blog.163.com/blog/static/17096277201261311949260/

typedef struct OFBragDelegateStrings
{
NSString* prepopulatedText;
NSString* originalMessage;
} OFBragDelegateStrings;


to

typedef struct OFBragDelegateStrings
{
__unsafe_unretained NSString* prepopulatedText;
__unsafe_unretained NSString* originalMessage;
} OFBragDelegateStrings;


參考:http://stackoverflow.com/questions/8093099/arc-forbids-objective-c-objects-in-structs-or-unions-despite-marking-the-file-f
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: