导航时iPhone应用程序崩溃

时间:2010-11-01 14:12:35

标签: iphone objective-c uitableview

我正在为iPhone开发一个rss阅读器,我有一个NSDictionary列表,其中包含网站名称和网址。当我点击DetailDisclosureButton时,它会带我到另一个带有网站提要的屏幕(我没有实现xlm解析器,所以它只是给我带来了屏幕)。这是我在应用程序崩溃后5次来回转换时出现的问题,并且它没有在日志中显示任何消息。

我不知道发生了什么,可能导致这样的错误?

谢谢!

- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath
// Gets the site;
NSDictionary *site = [sites objectAtIndex:indexPath.row];

// instantiate a view to see the unread news.
ViewUnreadController *uController = [[ViewUnreadController alloc] init];

uController.title = [site objectForKey:@"site"];
uController.site = site;

// adds the view to NavigationControllers stack (just adds a back button)
[self pushView:uController withBackTitle:@"Signatures"];

[site release];
[uController release];

我正在使用iPhone模拟器4.0的其他信息。

3 个答案:

答案 0 :(得分:1)

哈!我意识到我正在发布“网站”变量(不保留它),因为它指向NSMutableArray中的一个对象,引用计数达到零!

答案 1 :(得分:0)

当然,你过度释放/保留不足的东西。但是没有看到你的代码,没有人能够说出更多。

NSZombieEnabled可能会为您提供一些有用的信息

答案 2 :(得分:0)

嗯,你还没有真正给我们任何信息,所以它可能是很多东西。配置您的应用,在此处发布崩溃日志作为您问题的更新。这是在模拟器或设备上看到的吗?您使用的是哪种设备或模拟器中的设置?

任意猜测,也许你每次都在制作新的UIControllers和视图而你的内存已经用完了。但是,这只是一个黑暗的目标,你没有告诉我在哪里,或者它是否在那里。

相关问题