You declared CGRect
CGRect scrollerRect;
And you assigned a value to this after checking some conditions. If both conditions fail, then it will be without any value. Therefore, he gives a warning. Therefore, add an else clause and set the value to scrollerRect .
So you can have
if( self.interfaceOrientation == UIInterfaceOrientationPortrait || self.interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown ) { scrollerRect = CGRectMake( 0, 0, screenFrame.size.width, screenFrame.size.height ); } else if( self.interfaceOrientation == UIInterfaceOrientationLandscapeLeft || self.interfaceOrientation == UIInterfaceOrientationLandscapeRight ) { scrollerRect = CGRectMake( 0, 0, screenFrame.size.height, screenFrame.size.width ); } else { scrollerRect = CGRectZero; }
source share