ARC 禁止在结构或联合中使用 Objective-C 对象,尽管标记了文件 -fno-objc-arc?为什么会这样?
ARC forbids Objective-C objects in structs or unions despite marking the file -fno-objc-arc? Why is this so?
我假设如果你标记它 -fno-objc-arc 你没有这个限制.
I had the assumption that if you mark it -fno-objc-arc you don't have this restriction.
如果您收到此消息,请尝试 __unsafe_unretained.只有在结构中的对象未被保留时,它才是安全的.示例:如果您将 OpenFeint 与 ARC 一起使用,则 OFBragDelegateStrings 类会在结构中显示此错误.
If you got this message try __unsafe_unretained. It is only safe, if the objects in the struct are unretained. Example: If you use OpenFeint with ARC the Class OFBragDelegateStrings says this error in a struct.
typedef struct OFBragDelegateStrings
{
NSString* prepopulatedText;
NSString* originalMessage;
} OFBragDelegateStrings;
到
typedef struct OFBragDelegateStrings
{
__unsafe_unretained NSString* prepopulatedText;
__unsafe_unretained NSString* originalMessage;
} OFBragDelegateStrings;
这篇关于尽管标记了文件 -fno-objc-arc,但 ARC 禁止在结构或联合中使用 Objective-C 对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
KIF:如何自动运行/压力测试 iOS 应用程序以找出罕KIF: How to auto-run/stress test an iOS app to find the cause of a rare UI bug?(KIF:如何自动运行/压力测试 iOS 应用程序以找出罕见 UI 错
UITableView:在混合单元格表视图静态和动态单元格UITableView: Handle cell selection in a mixed cell table view static and dynamic cells(UITableView:在混合单元格表视图静态和动态单元格中
如何在 iOS 中删除 Safari 中的地址栏?How to remove Address Bar in Safari in iOS?(如何在 iOS 中删除 Safari 中的地址栏?)
在 iOS5 中从 CIImage 创建 UIImage 时遇到问题Having trouble creating UIImage from CIImage in iOS5(在 iOS5 中从 CIImage 创建 UIImage 时遇到问题)
获取所有相册的列表和每个相册的缩略图Get list of all photo albums and thumbnails for each album(获取所有相册的列表和每个相册的缩略图)
谁能帮我通过音频单元录制 iPhone 输出的声音Can anybody help me in recording iPhone output sound through Audio Unit(谁能帮我通过音频单元录制 iPhone 输出的声音)