ARC forbids Objective-C objects in structs or unions

Posted cxchanpin

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ARC forbids Objective-C objects in structs or unions相关的知识,希望对你有一定的参考价值。

解决方法有二种:
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

以上是关于ARC forbids Objective-C objects in structs or unions的主要内容,如果未能解决你的问题,请参考以下文章

[精通Objective-C]专家级技巧:使用ARC

Objective-c开发教程--MRC和ARC混编

Objective-c的内存管理MRC与ARC

Objective-C内存管理之ARC

Objective-C内存管理之ARC

Objective-C中,ARC下的 strong和weak指针原理解释