“Symbol not found” error for UIPopoverController in an iPhone/iPad Universal App

与世无争的帅哥 提交于 2019-12-07 15:24:25

Ahhhh nevermind. Check out Apple's example app "TopPaid"

It's kinda hacky, but it works. Wish there was a more elegant solution...

Class cls = NSClassFromString(@"UIPopoverController");
if (cls != nil)
{
    UIPopoverController *aPopoverController =
        [[cls alloc] initWithContentViewController:self.masterViewController];
    self.popoverController = aPopoverController;

    [aPopoverController release];

    [popoverController presentPopoverFromBarButtonItem:barButtonItem
                              permittedArrowDirections:UIPopoverArrowDirectionUp
                                              animated:YES];
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!