문제

-(void)viewWillAppear:(BOOL)animated
{

view1=[[BIDViewController alloc]initWithNibName:@"BIDViewController" bundle:nil];
[self willAnimateRotationToInterfaceOrientation:view1.interFaceOrientaion1 duration:1];
 }

-(void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}

     -(void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{

if (toInterfaceOrientation == UIInterfaceOrientationPortrait)
{
    lable1.frame=CGRectMake(100 ,102 ,225 , 21);
    [self setInterFaceOrientaion2:toInterfaceOrientation];
}

if(toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft)
{
    lable1.frame=CGRectMake(250, 116,225 ,21);
        [self setInterFaceOrientaion2:toInterfaceOrientation];
}
else if(toInterfaceOrientation == UIInterfaceOrientationLandscapeRight){
    lable1.frame=CGRectMake(250, 116, 225, 21);
    [self setInterFaceOrientaion2:toInterfaceOrientation];
}

}

@end

BIDViewController class could be able to access the property interFaceOrientation2, But BIDViewController2 class could not be able to access the property interFaceOrientation thought @class BIDViewController is present.

how to access this.

도움이 되었습니까?

해결책

Instead of calling properties change as per below Check orientation as below in viewWillApear method

UIInterfaceOrientation orientation=[[UIApplication sharedApplication] statusBarOrientation];
[self willAnimateRotationToInterfaceOrientation:orientation duration:1];
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top