0
    ContentsTableViewController *contentsTableViewController = [[ContentsTableViewController alloc] initWithStyle:UITableViewStylePlain];
    contentsTableViewController.delegate = self;

    popover = [[FPPopoverController alloc] initWithViewController:contentsTableViewController];
    [contentsTableViewController release];

    popover.tint = FPPopoverDefaultTint;
    popover.delegate = self;
    popover.contentSize = CGSizeMake(300, 500);
    popover.arrowDirection = FPPopoverArrowDirectionUp;

    [popover presentPopoverFromView:segmentedControl];
    //[popover presentPopoverFromPoint:CGPointMake(CGRectGetMinX(segmentedControl.frame), CGRectGetMaxY(segmentedControl.frame))];
    [popover release];

This is a part of my code.When I use the method presentPopoverFromPoint,it supported to show popoverView at the point,but it didn't.WHY?

By contrast,its another method presentPopoverFromView do work.But I must use the method presentPopoverFromPoint to present the PopoverView at a point.So how could I do?

Or,in other way,could I get left segment's view in the segmentedControl(There are two Segments in the segmentedControl)?

Reference: https://github.com/50pixels/FPPopover

JOM
  • 8,139
  • 6
  • 78
  • 111
Alpha
  • 21
  • 2

3 Answers3

0

The problem could be your segmentedControl. Is is a UISegmentedControl subclass ?

Are you sure isn't it (segmentedControl) nil ?

Alvise Susmel
  • 569
  • 4
  • 9
  • Even if i use presentPopoverFromPoint:CGPointMake(100,100),it still does't work.Whatever u change the point coordinate,the popoverView still present at the point near the (0,0). – Alpha Dec 21 '12 at 09:04
  • Thank you very much!I really like FPPopover,which helps me a lot. – Alpha Dec 22 '12 at 02:59
  • Try to see please what's the output of [popover originFromView: segmentedControl]; Is returning a CGPoint. Let me now! – Alvise Susmel Dec 23 '12 at 23:57
  • 1.[popover presentPopoverFromView:segmentedControl];NSLog(@"popoverView originPoint:%@", NSStringFromCGPoint([popover originFromView:segmentedControl]));output:popoverView originPoint:{270, 37}.2.[popover presentPopoverFromPoint:[popover originFromView:segmentedControl]]; NSLog(@"popoverView originPoint:%@", NSStringFromCGPoint([popover originFromView:segmentedControl]));output:popoverView originPoint:{270, 37}.But popoverView doesn't present at point {270, 37}. – Alpha Dec 24 '12 at 03:18
  • 1
    The problem has been in the Issues:https://github.com/50pixels/FPPopover/issues/11,which mentioned by avolovoy.When using the method presentPopoverFromPoint,in which [self setupView]-[self bestArrowDirectionAndFrameFromView:_fromView].There's no _fromView,so self.origin = CGPointMake(p.x + v.frame.size.width/2.0, p.y + v.frame.size.height/2.0),self.origin would be{0,0}.Then where's problem I think.HA~ – Alpha Dec 24 '12 at 08:00
0

I tried to use FPPopover previously and found it to not work correctly when using presentPopoverFromPoint. I did not have time to debug why.

combinatorial
  • 9,132
  • 4
  • 40
  • 58
0

Now guys that method is working correctly. Just download the latest version (tag 1.4)

Alvise Susmel
  • 569
  • 4
  • 9