【发布时间】:2011-09-08 10:59:45
【问题描述】:
如何从 contentViewController 中关闭弹出框,因此在下面的示例代码中,我想从 ProfileViewController 代码中关闭 UIPopOver。我该怎么做呢?另一个类似的帖子建议使用NSNotification,但是如何使用呢?
- (void)profilePop:(UITapGestureRecognizer *)recognizer
{
ProfileViewController * profile = [[ProfileViewController alloc] init];
CGPoint location = [recognizer locationInView:self.table];
NSIndexPath* indexPath = [self.table indexPathForRowAtPoint:location];
ConvoreCell* cell = (ConvoreCell *) [self.table cellForRowAtIndexPath:indexPath];
profile.uid = [[[self.posts objectAtIndex:indexPath.row] creator] mid];
UIPopoverController * profilePop = [[UIPopoverController alloc] initWithContentViewController:profile];
[profilePop setPopoverContentSize:CGSizeMake(350, 180)];
[profilePop presentPopoverFromRect:CGRectMake(0,0, cell.avatar.frame.size.width, cell.avatar.frame.size.height) inView:cell permittedArrowDirections:UIPopoverArrowDirectionLeft animated:YES];
}
【问题讨论】:
标签: iphone objective-c uipopovercontroller