EDIT:それは私のせいでした。UIPopoverControllerがpresentPopoverFromに表示されない
私は君たちの一つは、いくつかの提案を提供することを願って、これは今働いていない理由としてはかなり混乱して取得しています:
// Initialise and setup the sharing view:
sharePopVC = [[SharePopViewController alloc] init];
// Create the pop-over we're gonna put it in:
myPopover = [[UIPopoverController alloc] initWithContentViewController:sharePopVC];
// Confirm nothing is null or anything odd:
NSLog(@"sharePopVC = %@", sharePopVC);
NSLog(@"myPopover = %@",myPopOver);
// Present the popover:
// Not my ideal parameters but 'safe' ones:
[myPopover presentPopoverFromRect:CGRectMake(100,100,100,100) inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
// Does it even believe that it's visible.
if (myPopOver.isPopoverVisible) {
NSLog(@"Popover is there, apparently..");
} else {
NSLog(@"We concede the popover is NOT visible..");
}
コンソール出力:
2012-04-11 17:31:37.345 sharePopVC = <SharePopViewController: 0x19c720>
2012-04-11 17:31:37.348 myPopover = <UIPopoverController: 0x14b180>
2012-04-11 17:31:37.349 We concede the popover is NOT visible..
をともちろん、何も表示されません。私は他の場所でうまく動作するほぼ同じコードを持っています。何が出現するのを防ぐことができますか?
私はUBarButtonItemからプレゼンテーションしようとしましたが、それは私のrectとは関係がありましたが、助けにはならなかったからです。私は何とかすべて0に設定されていて問題が発生したが、そこにも喜びがない場合に備えて、私のsharePopVC.view
のフレームを強制的に設定しようとしました。
self.view
このケースでは、UINavigationControllerやUIScrollViewのようないくつかのサブビューを含むメインのビューです。
ありがとうございました。