Uialertview和内存管理 [英] Uialertview and memory management

查看:95
本文介绍了Uialertview和内存管理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我alloc unit一个UIAlertview,然后show.我应该在show之后还是release?

If I alloc unit a UIAlertview and then show it. Should I release it after the show or should I autorelease it?

推荐答案

这是显示警报的常用方法:

This is the common way of showing an alert:

UIAlertView *alert = [[UIAlertView alloc] initWithTitle: @"Title:" 
                                                message: @"The Message"
                                               delegate: self
                                      cancelButtonTitle: @"OK"
                                      otherButtonTitles: nil];
[alert show];
[alert release];

这篇关于Uialertview和内存管理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆