首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >[ xcode成功发布];xcode 4.2

[ xcode成功发布];xcode 4.2
EN

Stack Overflow用户
提问于 2011-11-10 17:00:10
回答 1查看 749关注 0票数 0

我在Xcode 4.2中看到一个错误,它发布了alertsuccess。它说释放是不可用的,并且在自动引用计数模式下不可用,并且ARC禁止显式发送释放的消息。

我的应用程序和代码可以在Xcode 4.1中运行。怎么啦?

代码语言:javascript
复制
    if([serverOutput isEqualToString:@"Yes"]){


    UIAlertView *alertsuccess = [[UIAlertView alloc] initWithTitle:@"Congrats" message:@"You are authorized "
                                                          delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];

    [alertsuccess show];
    [alertsuccess release];




} else {
    UIAlertView *alertsuccess = [[UIAlertView alloc] initWithTitle:@"Error" message:@"Username or Password Incorrect"
                                                          delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
    [alertsuccess show];
    [alertsuccess release];

}
EN

回答 1

Stack Overflow用户

发布于 2011-12-01 04:53:42

有了自动引用计数,你不应该再自己保留和释放对象了。

您可以在项目的构建设置中禁用ARC,也可以删除对-release的调用。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/8077034

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档