- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[myTableView deselectRowAtIndexPath:indexPath animated:YES];
if (self.newPopover == nil)
{
TasksViewController *tasksViewController = [[TasksViewController alloc] init];
tasksViewController.navigationItem.title = @"Whatever you like";
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:tasksViewController];
UIPopoverController *popover = [[UIPopoverController alloc] initWithContentViewController:navController];
popover.delegate = self;
[tasksViewController release];
[navController release];
self.newPopover = popover;
[popover release];
}
newPopover.popoverContentSize = CGSizeMake(320, 360);
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
[newPopover presentPopoverFromRect:cell.bounds inView:cell.contentView permittedArrowDirections:UIPopoverArrowDirectionLeft animated:YES];
}
No comments:
Post a Comment