I am creating an application for an iPad, and I want to show UIPopoverControllerwith an arrow pointing to the details button for the row to which it belongs. I want to do this in a method tableView:accessoryButtonTappedForRowWithIndexPath:. I currently have this, with a mannequin CGRect:
- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath {
[addFeedPopup dismissPopoverAnimated:YES];
TNSubscribeToFeedController *subscribeToFeedController = [[TNSubscribeToFeedController alloc] initWithNibName:@"SubscribeToFeed" bundle:nil];
UINavigationController *subscribeToFeedNavigationController = [[UINavigationController alloc] initWithRootViewController:subscribeToFeedController];
subscribeToFeedController.title = @"Subscribe to feed";
subscribeToFeedController.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:nil];
subscribeToFeedController.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:nil];
addFeedPopup = [[UIPopoverController alloc] initWithContentViewController:subscribeToFeedNavigationController];
addFeedPopup.popoverContentSize = CGSizeMake(480, 320);
[addFeedPopup presentPopoverFromRect:CGRectMake(0, 0, 20, 20) inView:self.view permittedArrowDirections:UIPopoverArrowDirectionLeft animated:YES];
[subscribeToFeedNavigationController release];
[subscribeToFeedController release];
}
In addition, when UITableViewin edit mode, the disclosure button is about 60 pixels to the left, since I use it to adjust my lines:
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"SectionTwoCell"] autorelease];
}
cell.textLabel.text = [NSString stringWithFormat:@"Feed %d", indexPath.row];
cell.detailTextLabel.text = @"Description";
cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;
cell.editingAccessoryType = cell.accessoryType;
Can someone help me with this problem? Thank.
Oh, and you can also turn off scrolling and turn off the selection of something until UIPopoverControllerit is closed (perfectionism)?
user142019