2012-05-04 56 views

回答

1

您可以達到您所描述的效果。


-(void)tableView:(UITableView *)tv didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ 
    [tv deselectRowAtIndexPath:indexPath animated:YES]; 
    double delayInSeconds = .3; 
    dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC); 
    dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ 
     Location *loc = [self.locations objectAtIndex:indexPath.row]; 
     LocationDetailsController *locationDetails = [[[LocationDetailsController alloc] initWithNibName:nil bundle:nil] autorelease]; 
     locationDetails.location = loc; 
     [self.navigationController pushViewController:locationDetails animated:YES]; 
    }); 
} 
 
相關問題