- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
有时我的应用程序因显示 * Collection 在被枚举时发生了变异而崩溃。这一直发生在同一行代码中。请帮助我解决这个问题。我坚持这一点。该应用程序在推送我的代码的 View Controller 行时崩溃。但这并不常见。我的错误控制台
由于未捕获的异常“NSGenericException”而终止应用程序,原因:“* Collection CALayerArray: 0x1030c730 在枚举时发生了突变。
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
“”
)'
我的代码:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
ServiceDetails *service=[[ServiceDetails alloc] initWithNibName:@"ServiceDetails" bundle:nil];
CompanyListingForm *list=[[CompanyListingForm alloc]initWithNibName:@"CompanyListingForm" bundle:nil];
[category_company_text resignFirstResponder];
if(viewHoldingTable)
{
[viewHoldingTable removeFromSuperview];
}
if (category_clicked_flag==0) {
if (location_or_cat_com==0) {
NSMutableArray *get=[district_array objectAtIndex:indexPath.row];
locationid=[[get objectAtIndex:0]intValue];
[location_textfield resignFirstResponder];
location_textfield.text=[get objectAtIndex:1];
}
else
{
if (draggingView) {
[draggingView removeFromSuperview];
}
if (viewHoldingTable) {
[viewHoldingTable removeFromSuperview];
}
NSMutableArray *get=[company_array objectAtIndex:indexPath.row];
category_company_text.text=[get objectAtIndex:1];
service.ida=[NSString stringWithFormat:@"%d",[[get objectAtIndex:0] intValue]];
service.idloc=[NSString stringWithFormat:@"%d",locationid];
[self.navigationController pushViewController:service animated:YES];//getting error at this point.
//[emer release];
}
}
else
{
if (location_or_cat_com==0) {
NSMutableArray *get=[district_array objectAtIndex:indexPath.row];
locationid=[[get objectAtIndex:0]intValue];
[location_textfield resignFirstResponder];
location_textfield.text=[get objectAtIndex:1];
}
else
{
NSMutableArray *get=[category_array objectAtIndex:indexPath.row];
category_company_text.text=[get objectAtIndex:1];
int catid=[[get objectAtIndex:0]intValue];
list.IDForLoc=[NSString stringWithFormat:@"%d",locationid];
list.IDForCat=[NSString stringWithFormat:@"%d",catid];
list.companydetails=[get objectAtIndex:1];
[self.navigationController pushViewController:list animated:YES];//getting error at this point.
}
}
[service release];
[list release];
}
最佳答案
我认为问题在于您在要求推送 View Controller 的同时对界面执行所有这些操作。尝试包装 pushViewController
dispatch_after
中的一行 block ,例如延迟 0.1 秒,以使接口(interface)的其他更改有时间稳定下来。或者换一种方式:把 removeFromSuperview
东西变成延迟。更好的是,抛出某种标志,以便稍后在 viewWillAppear
上删除要从 super View 中删除的内容。 .您现在不需要这样做;无论如何,您将要隐藏以使用推送的 View Controller 覆盖此 View 。
关于iphone - 由于未捕获的异常 'NSGenericException' 终止应用程序,原因 : '*** Collection <CALayerArray: 0x66522e0> was mutated while being enumerated,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13577486/
我目前正在尝试弄清楚如何使用iOS 10的AVCapturePhotoOutput方法,但遇到了麻烦。我觉得自己即将做对,但继续收到错误消息: 由于未捕获的异常“NSGenericException”
简单这是我的代码 func showMessageView(){ let leftConstraint = messageView.leftAnchor.constraintEqualToAn
我正在使用 UIImagePickerController 从 iphone 库加载保存的照片。但是当我向上或向下滚动图像时,我的应用程序崩溃了.. 我收到以下错误: 2011-04-21 14:26
我正在使用 NSMutableArray 来存储在我的 View 中显示的一些 UIView 对象。我正在使用 NSTimer 连续调用一个方法来检查该数组的内容并收到一些错误。 这是控制台的堆栈跟踪
这是我在出现 SKScene 时看到的错误,此错误发生随机并且无法复制 * 由于未捕获的异常“NSGenericException”而终止应用程序,原因:“* 集合 在枚举时发生了变异。” 这是怎么回
以下代码: listViewPopoverControllerOL = [[UIPopoverController alloc] initWithContentViewController:myBra
我目前正在尝试弄清楚如何使用 iOS 10 的 AVCapturePhotoOutput 方法,但遇到了困难。我觉得我即将做对,但仍然收到错误: Terminating app due to unca
由于未捕获的异常“NSGenericException”而终止应用 Terminating app due to uncaught exception 'NSGenericException', re
我正在开发一个在 iPhone 上运行的应用程序运行良好,但是当我尝试在 iPad 上运行时它崩溃了 这是我的代码: - (void)parseCountryStates:(NSDictionary
在我的 iPhone 应用程序中,我正在尝试使用 uicollectionView 实现一个图片库。当 was mutated while being enumerated.' *** First
我正在努力寻找和思考这个问题,但我找不到解决它的最佳方案!!我不明白这是什么意思?! Terminating app due to uncaught exception 'NSGenericExcep
我正在使用 [self.view addSubview:myView] 添加一个 View 作为 subview .这在纵向模式下工作正常。但是,它在风景中根本不起作用。如何以编程方式添加布局约束?
我在尝试运行我的应用程序并拍摄照片时不断收到上述错误消息。 我是编程新手,所以如果有人能提供帮助那就太棒了。 这是我的代码 import UIKit import AVFoundation impor
当我的代码如下所示时,我遇到“集合在枚举时发生变化”异常: NSString *poiStr = nil; int SuccessValue=0; NSMutableArray* po
有时我的应用程序因显示 * Collection 在被枚举时发生了变异而崩溃。这一直发生在同一行代码中。请帮助我解决这个问题。我坚持这一点。该应用程序在推送我的代码的 View Controller
我得到这个 NSGenericException 原因是 Collection was mutated while being enumerated 即使我实际上并没有在我的代码中使用快速枚举。 当
我不明白问题所在,但我猜是 Storyboard 中的问题(在我的限制下,因为有时对象不在它们必须在的位置)。 * 由于未捕获的异常“NSGenericException”而终止应用程序,原因:“*
我正在尝试从数组中删除重复的对象。 NSMutableArray* filterResults = [[NSMutableArray alloc] init]; BOOL copy;
我正在使用 Alamofire,在我的应用程序在模拟器上运行几个小时后,我遇到了崩溃并出现此错误。 *** Terminating app due to uncaught exception 'NSG
所以我正在制作一个包含 5 个 View Controller 的应用程序,第一个嵌入在 UINavigationController 中,前 4 个 View Controller 之间的连接工作正
我是一名优秀的程序员,十分优秀!