Note that there are some explanatory texts on larger screens.

plurals
  1. POAdding Popover to TableViewCell
    text
    copied!<p>I've been struggling with this for awhile and was hoping anyone could shed some light on why this isn't working.</p> <p>I'm simply try to implement a Popover on a TableViewCell. Here is the code..</p> <p><strong>TodoView.m</strong></p> <pre><code>- (void)tableView:(TUITableView *)tableView didClickRowAtIndexPath:(TUIFastIndexPath *)indexPath withEvent:(NSEvent *)event { // MyViewController is a TUIViewController with a nib called MyView with just a button in it MyViewController *t = [[MyViewController alloc] initWithNibName:@"MyView" bundle:nil]; TUIView *theView = [[TUIView alloc] initWithFrame:NSMakeRect(0, 0, 300, 300)]; TUIPopover *myPopover = [[TUIPopover alloc] initWithContentViewController:t]; [myPopover showRelativeToRect:NSMakeRect(0, 0, 300, 300) ofView:theView preferredEdge:NSMaxYEdge]; } </code></pre> <p>For awhile, nothing would show up. I could tell something was happening though because the window itself would lose focus as if a Popover <em>was</em> there.</p> <p>Sometimes I see a very small blip– like a small rectangle 2px by 2px. It's hard to see it, looks like dead pixel on the screen, but it appears sometimes when I run this code.</p> <p>The TUIPopover is from the <a href="https://github.com/twitter/twui" rel="nofollow">Twitter UIKit Framework</a>.</p> <p><em>Some possibilities...</em></p> <p>1) The popover cannot be seen over the CGFillRect?</p> <p><strong>TodoTableViewCell.m</strong> </p> <pre><code>- (void)drawRect:(CGRect)rect { CGRect b = self.bounds; CGContextRef ctx = TUIGraphicsGetCurrentContext(); CGContextSetRGBFillColor(ctx, 247.0/255, 247.0/255, 247.0/255, 1); CGContextFillRect(ctx, b); } </code></pre> <p>2) The popover doesn't fit inside the TableViewCell and cannot be seen</p> <p>Anyone have any thoughts?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload