ios - 使用 UrbanAirship 库编译代码出现 "release not available"错误

标签 ios ios5 ios6 apple-push-notifications urbanairship.com

<分区>

我将 UrbanAirship 库添加到我的代码中,但在编译 UAPushSettingsAliasViewController.m 时遇到此类错误和 UAInboxMessageListCell.m以及一些类似的类(class)。此方法发生错误:

- (void)dealloc {

    RELEASE_SAFELY(tableView);
    RELEASE_SAFELY(aliasCell);
    RELEASE_SAFELY(textCell);
    RELEASE_SAFELY(textLabel);
    RELEASE_SAFELY(aliasField);

    [super dealloc];
}

大多数错误是 "release not available: not available in automatic reference counting mode"

有人知道为什么会发生这种情况以及我该如何解决这个问题吗?

谢谢, 亚历克斯

最佳答案

这是因为您正在使用 deallocreleaseretain 等功能,这些功能在 ARC 中不需要,因为它会自动管理内存。您可以在build设置中关闭 ARC,或者将 -fno-objc-arc 添加到不使用 ARC 的文件的编译器标志中。

在build设置中 enter image description here

对于-fno-objc-arc,请在此处添加

enter image description here

通过双击编译器标志来添加它,并将其添加到包含 retainautoreleaserelease[ super dealloc].

关于ios - 使用 UrbanAirship 库编译代码出现 "release not available"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15670375/

上一篇:ios - 使用 Instapaper API 时,为什么我不断收到 401 错误?

下一篇:iphone - ASIHTTPRequest 自定义进度跟踪

相关文章:

objective-c - 定时 UIAlert 每 60 秒触发一次,无论我使用什么延迟

iphone - 录制的视频方向问题

c# - MonoTouch.Dialog 并排放置两列

iOS越狱-如何在后台获取位置

iOS5 打破了 UISplitViewController 旋转回调,如何手动调用?

iphone - 尝试使用 Twitter ACAccount 时的奇怪行为

xcode - 创建 LiveCode IOS 独立应用程序

ios - Xcode 6 Size Classes 中的自定义字体大小无法与自定义字体一起正常工作

android - Zendesk SDK与API

ios - UIStoryBoard 从 ApplicationDelegate 获取第一个 View Controller