我正在将我的项目转换为 ARC
我在我的项目中使用结构。
转换为 ARC 时出现错误
ARC forbids Objective-C objects in structs or unionsrk - type definition for struct
我在 SO 中搜索,发现使用__unsafe_unretained
.It 可以解决问题。所以我在我的结构中使用了它。
typedef struct Grade{
__unsafe_unretained NSString *Table,
*RowId,
*ScheduleID,
*Level,
*Label,
*Thershold;
char *CreateStmt;
} grade;
它正在工作,但现在它在下一行显示相同的错误*RowId
。
我的问题是我应该把 __unsafe_unretained 放在所有变量之前。这样做安全吗?或者有另一种方法来解决这个问题。