tableview cell is responding very slow on tap
<p>I have created the small application using the web services. The problem is when i tap on one of the cell, it takes time to launch other table view (approx 5-6 seconds) .I think my code is not optimized. help me!!</p>

<p>here is my code
rootviewcontroller.m</p>

<pre><code>- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    if(bdvController == nil)
    bdvController = [[BookDetailViewController alloc] initWithNibName:@"BookDetailView" bundle:[NSBundle mainBundle]];
if(indexPath.section == 0)
{       
    Book *aBook = [appDelegate.books objectAtIndex:indexPath.row];
    bdvController.aBook = aBook;
}
else if(indexPath.section == 1)
{
    Book *aBook = [appDelegate.books objectAtIndex:indexPath.row+5*indexPath.section];
bdvController.aBook = aBook;
}
[self.navigationController pushViewController:bdvController animated:YES];
}
</code></pre>

<p>where 'aBook' is object of Book class having property of all its declared object.And Books is an array.</p>

<p>bookDetailview.</p>

<pre><code>- (UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *CellIdentifier = @"Cell";
ImageCell *cell = (ImageCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier]; // creating cell from ImageCell.m
    if (cell == nil) {
    cell = [[[ImageCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease]; // allocating with frame
    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
}
     EmpDictionary=[[NSMutableDictionary alloc]init];
[EmpDictionary setValue:aBook.Url forKey:@"url"];
[EmpDictionary setValue:aBook.Subcatname forKey:@"subcatname"];
[EmpDictionary setValue:aBook.Catname forKey:@"catname"];
EmpArray=[[NSMutableArray alloc]init];
[EmpArray addObject:EmpDictionary];

CGRect myImageRect = CGRectMake(0.0f, 124.0f, 320.0f, 356.0f);
img = [[UIImageView alloc] initWithFrame:myImageRect];

NSString *tempstr=[EmpDictionary objectForKey:@"url"]; 
tempstr=[tempstr stringByReplacingOccurrencesOfString:@"\n    h" withString:@"h"];
self.img.image = [UIImage imageWithData: [NSData dataWithContentsOfURL: [NSURL URLWithString:tempstr]]];

NSDictionary *itemAtIndex = [self.EmpArray objectAtIndex:indexPath.row];
[cell setData:itemAtIndex]; //call to 'setData' method to ImageCell.m
NSLog(@"set text of a cell"); 
return cell;
</code></pre>

<p>}</p>

<pre><code>- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
jscontroller = [[JSONViewController alloc] initWithNibName:@"JSONView" bundle:nil];


 EmpDictionary=[[NSMutableDictionary alloc]init];
[EmpDictionary setValue:aBook.Url forKey:@"url"];
[EmpDictionary setValue:aBook.Subcatname forKey:@"subcatname"];
[EmpDictionary setValue:aBook.Catname forKey:@"catname"];
EmpArray=[[NSMutableArray alloc]init];
[EmpArray addObject:EmpDictionary];

EmpDictionary1=[[NSMutableDictionary alloc]init];
[EmpDictionary1 setValue:aBook.Url forKey:@"url"];

jscontroller.jsonItem = [[NSMutableDictionary alloc]init];
jscontroller.jsonItem = EmpDictionary1;
    itemAtIndex = [self.EmpArray objectAtIndex:indexPath.row];
[self.navigationController pushViewController:jscontroller animated:YES];
[jscontroller setData:itemAtIndex];       
 }
</code></pre>
