Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XCode 6.3 Warning : Comparison of address of {object} not equal to null pointer is always true #163

Open
michael75431 opened this issue Apr 13, 2015 · 1 comment

Comments

@michael75431
Copy link

WYPopoverController line 3094, certain comparison issues

Suggested fix

CGRect anotherRect;
UIView *anotherInView;

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

// prior comparison was not needed, anotherRect will always have a value

rect = anotherRect;

// compare the object, not the address

if (anotherInView != nil) {
inView = anotherInView;
}

@dgatwood
Copy link

dgatwood commented Jul 9, 2015

IMO, it's a good practice to initialize variables first before such calls. It may or may not be strictly necessary, depending on the method you're calling and depending on whether you're using ARC, but it would raise fewer red flags in my mind if you set anotherInView to nil when you declare it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants