objective c - Determine if a view is inside of a Popover view -
we have common views use in our application in many locations inside of uinavigationcontrollers
. uinavigationcontroller
s inside of popover views. views put nav controllers modify navigation controller's toolbar buttons and, in cases, use custom buttons we've created. need able figure out uiviewcontroller
if view inside of popoverview can display correctly colored buttons.
we can navigation controller reference uiviewcontroller, using uiviewcontroller.navigationcontroller
, there doesn't seem finding uipopovercontroller
.
does have ideas how this?
thanks!
i looking way determine wether or not view being displayed in popover. came with:
uiview *v=theviewinquestion; (;v.superview != nil; v=v.superview) { if (!strcmp(object_getclassname(v), "uipopoverview")) { nslog(@"\n\n\nim in popover!\n\n\n\n"); }
basically climb view's superview tree looking see if of superviews uipopoverview. 1 caveat here class uipopoverview undocumented private class. i'm relying on fact class name won't change in future. ymmv.
in case:
theviewinquestion = theviewcontrollerinquestion.view;
i'd interested see if else comes better solution.
Comments
Post a Comment