Can anyone tell me why this comparison keeps making my app freeze and crash?
NSArray *viewControllerArray = [controlFromMap.navigationController viewControllers];
NSUInteger parentViewControllerIndex = [viewControllerArray count] - 3 // or - whatever;
NSLog(@"Parent view controller: %@", [viewControllerArray objectAtIndex:parentViewControllerIndex]);
if([[[viewControllerArray objectAtIndex:parentViewControllerIndex]stringValue] isEqualToString: @"FromAddressController"]){
_mapView.showsUserLocation = NO;
}
else{
_mapView.showsUserLocation = YES;
}