如何解除contentViewController的彈出窗口,所以在下面的示例代碼中,我想從ProfileViewController代碼中解除UIPopOver。我該怎麼做呢?另一個類似於此的帖子建議使用NSNotification,但如何使用它?解僱來自contentViewController的UIPopOverController
- (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];
}
這可能是要走的路。還有許多其他情況,您需要將其他消息從內容視圖控制器發送到第一個視圖控制器,因此這是一個很好的模式。 – CharlieMezak 2011-05-17 23:08:46