Use indexOfObjectIdenticalTo since we only care if the pointers are equal. Thanks @Adlai-Holler!

This commit is contained in:
Garrett Moon 2016-07-07 11:13:18 -07:00
parent 8081123cb2
commit b79641d4ee
2 changed files with 2 additions and 2 deletions

View File

@ -39,7 +39,7 @@ ASVisibilityDepthImplementation;
- (NSInteger)visibilityDepthOfChildViewController:(UIViewController *)childViewController - (NSInteger)visibilityDepthOfChildViewController:(UIViewController *)childViewController
{ {
NSUInteger viewControllerIndex = [self.viewControllers indexOfObject:childViewController]; NSUInteger viewControllerIndex = [self.viewControllers indexOfObjectIdenticalTo:childViewController];
if (viewControllerIndex == NSNotFound) { if (viewControllerIndex == NSNotFound) {
//If childViewController is not actually a child, return NSNotFound which is also a really large number. //If childViewController is not actually a child, return NSNotFound which is also a really large number.
return NSNotFound; return NSNotFound;

View File

@ -39,7 +39,7 @@ ASVisibilityDepthImplementation;
- (NSInteger)visibilityDepthOfChildViewController:(UIViewController *)childViewController - (NSInteger)visibilityDepthOfChildViewController:(UIViewController *)childViewController
{ {
NSUInteger viewControllerIndex = [self.viewControllers indexOfObject:childViewController]; NSUInteger viewControllerIndex = [self.viewControllers indexOfObjectIdenticalTo:childViewController];
if (viewControllerIndex == NSNotFound) { if (viewControllerIndex == NSNotFound) {
//If childViewController is not actually a child, return NSNotFound which is also a really large number. //If childViewController is not actually a child, return NSNotFound which is also a really large number.
return NSNotFound; return NSNotFound;