Terminating app due to uncaught exception 'NSGenericException', reason: '*** Collection <CALayerArray: 0x66522e0> was mutated while being enumerated
Posted
by
fahu
on Stack Overflow
See other posts from Stack Overflow
or by fahu
Published on 2012-11-27T04:38:58Z
Indexed on
2012/11/28
5:05 UTC
Read the original article
Hit count: 1094
some times my app crashed by showing * Collection was mutated while being enumerated . This is occurring in same line of code all the time.please help me on this issue. i stuck on this. the app is crashing at pushing view controller line of my code.but it is not frequent one. my error console
Terminating app due to uncaught exception 'NSGenericException', reason: '* Collection CALayerArray: 0x1030c730 was mutated while being enumerated. "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" )'
my code:
- (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];
}
© Stack Overflow or respective owner