Hi All
I am using following code for showing a next view(tableview) in Iphone app.
It sometime works and some time app crashes without any exception log
NSLog(@"Ok"); is log everytime 50% attempts application crashes
-(IBAction)statusInitiationButAction:(id)sender{
@try {
NSArray *tempArrIniId = [eventInitiationArray valueForKey:@"act_id"];
int s;
if([tempArrIniId containsObject:selectedInitiateId]){
s=[tempArrIniId indexOfObject:selectedInitiateId];
}
[tempArrIniId release];
NSString *selStatusId = [NSString stringWithString:[[eventInitiationArray objectAtIndex:s] objectForKey:@"status_id"]];
for (int i=0; i<[statusInitiationArray count]; i++) {
id statusDict = [statusInitiationArray objectAtIndex:i];
if ([selStatusId intValue] == [[statusDict objectForKey:@"id"] intValue]) {
[statusDict setValue:@"1" forKey:@"selected"];
[statusInitiationArray replaceObjectAtIndex:i withObject:statusDict];
}else {
[statusDict setValue:@"0" forKey:@"selected"];
[statusInitiationArray replaceObjectAtIndex:i withObject:statusDict];
}
}
NSLog(@"statusInitiationTable...%@",statusInitiationArray);
[statusInitiationTable.tableView reloadData];
[[self navigationController] pushViewController:statusInitiationTable animated:YES];
NSLog(@"ok");
}@catch (NSException * e) {
NSLog(@"statusInitiationButAction....%@",e);
}
}
Can anybody guide me about the problem.
Thanks
Amit Battan