objective c - UIPopoverController in iOS 8 -


everybody says uipopovercontroller work on ios 8.

but if test app in iphone simulator getting crashed , log says:

terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[uipopovercontroller initwithcontentviewcontroller:] called when not running under uiuserinterfaceidiompad.'

this code works fine on ipad simulator.

my development target set 8.4

uiviewcontroller* viewcontroller = [[uiviewcontroller alloc] initwithnibname:@"stylemenu" bundle:nil];     self.stylepopover = [[uipopovercontroller alloc] initwithcontentviewcontroller:viewcontroller];     self.stylepopover.popovercontentsize = cgsizemake(250,200);     [self.stylepopover presentpopoverfrombarbuttonitem:stylebarbutton                                permittedarrowdirections:uipopoverarrowdirectionup                                                animated:yes]; 

any appreciated.

yes, possible starting ios8. have gave answer similar question , implemented useful class work popovers on iphone , put custom elements there, such uitableview, wkwebview, name it.
can check out answer , link class here: https://stackoverflow.com/a/30418212/2924920


Comments