Skip to content

Commit

Permalink
Changed code to call delegate method to possibly reposition the popover
Browse files Browse the repository at this point in the history
to use pointer correctly - got rid of need for pragmas to turn off compiler
warnings that were actually valid.
  • Loading branch information
littlepotatosoftware committed Apr 12, 2015
1 parent 81cc469 commit cf3745b
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions WYPopoverController/WYPopoverController.m
Original file line number Diff line number Diff line change
Expand Up @@ -2855,21 +2855,18 @@ - (void)didChangeDeviceOrientation:(NSNotification *)notification {
_inView = [_barButtonItem valueForKey:@"view"];
_rect = _inView.bounds;
} else if ([_delegate respondsToSelector:@selector(popoverController:willRepositionPopoverToRect:inView:)]) {
CGRect anotherRect;
UIView *anotherInView;
CGRect anotherRect = CGRectZero;
UIView *anotherInView = nil;

[_delegate popoverController:self willRepositionPopoverToRect:&anotherRect inView:&anotherInView];

#pragma clang diagnostic push
#pragma GCC diagnostic ignored "-Wtautological-pointer-compare"
if (&anotherRect != NULL) {
if (!CGRectEqualToRect(anotherRect, CGRectZero)) {
_rect = anotherRect;
}

if (&anotherInView != NULL) {
if (anotherInView != nil) {
_inView = anotherInView;
}
#pragma GCC diagnostic pop
}

[self positionPopover:NO];
Expand Down

0 comments on commit cf3745b

Please sign in to comment.