0
这里我有一个疑问,我有一个MasterViewController,它没有Superview,我的标签是全局声明的,也用于不同的功能。 我的问题是如何释放分配的标签。如果我使用autorelease,那么它会生成异常。如何在MasterViewController中释放对象
- (id)init {
if(self = [super init]) {
mview = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]];
//mview.backgroundColor=[UIColor clearColor];
mview.autoresizesSubviews=YES;
tableView = [[UITableView alloc] initWithFrame:CGRectMake(0,220,320,440) style:UITableViewStyleGrouped];
tableView.delegate = self;
tableView.dataSource = self;
tableView.rowHeight = 45;
tableView.backgroundColor = [UIColor clearColor];;
tableView.separatorColor = [UIColor blackColor];
[tableView setSectionHeaderHeight:15];
[tableView setSectionFooterHeight:10];
[mview addSubview:tableView];
}
for example here I declared table view as global how can i release it?Is it possible to release in dealloc.I place a printf statement in dealloc but it was not displaying.
Anyone's help will be appreciated.
Thank you,
Monish Kumar.
嘿家伙,请帮我这个。 – monish 2010-02-09 11:43:55
你可以在这里发布一些代码吗? – Vladimir 2010-02-09 11:56:06