【问题标题】:How save add items on memory after close app?关闭应用程序后如何在内存中保存添加项目?
【发布时间】:2010-10-19 21:28:44
【问题描述】:

为什么我的添加项目没有节省内存?当我回到 RootViewController 我的列表消失了,发生了什么?

添加代码并正常工作...

- (IBAction) addButtonPressed: (id)sender {
 NSLog(@"Add button pressed!");

 addPosto *addposto = [[addPosto alloc] initWithNibName:@"postoDictionary" bundle:nil];
 UINavigationController *addNavCon = [[UINavigationController alloc] initWithRootViewController:addposto];
 addposto.postoArray = self.poscomb;
 [self presentModalViewController:addNavCon animated:YES];
 [addposto release];
 [addNavCon release];

}

在 RootViewController 上选择“Meus Postos”行

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

   postoLista *codigo = [[postoLista alloc] initWithNibName:@"postoLista" bundle:nil];
   [self.navigationController pushViewController:codigo animated:YES];
   [codigo release];

}

所以我需要知道添加项目后如何在内存中归档列表,谢谢关注!

爱德华多·帕鲁克。

【问题讨论】:

  • 在 addposto.postoArray 中保存后如何更新 poscomb?您没有发布代码。

标签: iphone uitableview state


【解决方案1】:

我与巴西 Instants Games 的 Leonardo 交谈,他实现了一个单例并解决了我的问题,所以我认为就是这样!感谢所有帮助!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-04-01
    • 1970-01-01
    • 2011-10-04
    • 1970-01-01
    • 1970-01-01
    • 2016-12-30
    相关资源
    最近更新 更多