Hi,
I have an UITableView that contains 3 NSArrays and 3 NSDictionaries for each array.
- (void)viewDidLoad {
[super viewDidLoad];
contentArray = [[NSMutableArray alloc] init];
self.settingsArray = [NSArray arrayWithObjects:@"Settings", nil];
NSDictionary *settingsDict = [NSDictionary dictionaryWithObject:settingsArray forKey:@"Settings"];
self.infoArray = [NSArray arrayWithObjects: @"Version 1.0", @"© Copyrights 2010", @"Developer Site", @"App Page", @"Report a Bug", nil];
NSDictionary *infoDict = [NSDictionary dictionaryWithObject:infoArray forKey:@"Settings"];
self.contactArray = [NSArray arrayWithObjects: @"Developer Site", @"App Page", @"Report a Bug", nil];
NSDictionary *contactDict = [NSDictionary dictionaryWithObject:contactArray forKey:@"Settings"];
[contentArray addObject:infoDict];
[contentArray addObject:settingsDict];
[contentArray addObject:contactDict];
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
if ([[infoArray objectAtIndex:indexPath.row] isEqual:@"Version 1.1"]) {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
}
if ([[infoArray objectAtIndex:indexPath.row] isEqual:@"© Copyrights 2010"]) {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
}
if ([[settingsArray objectAtIndex:indexPath.row] isEqual:@"Settings"]) {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Title" message:@"NULL" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
}
if ([[contactArray objectAtIndex:indexPath.row] isEqual:@"Developer Site"]) {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
}
if ([[contactArray objectAtIndex:indexPath.row] isEqual:@"App Page"]) {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
}
if ([[contactArray objectAtIndex:indexPath.row] isEqual:@"Report a Bug"]) {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
}
}
The problem is when I'm trying to select a row, the application is crashing
Thanks