im working on a old code and i have this warning message:
Passed-by-value struct argument contains uninitialized data (e.g., via the field chain: ‘origin.x’). If i could get dome help i would be very thankful 🙂
The code im using:
- (void)positionScroller
{
CGRect screenFrame = [[UIScreen mainScreen] bounds];
CGRect scrollerRect;
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 );
}
_scroller.frame = scrollerRect; <---This is where the compiler gives the warning
}
Best Regards.
You can easily get rid of the warning like this: