0
-(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];
}

}

@结尾

BIDViewController 类可以访问属性 interFaceOrientation2,但 BIDViewController2 类无法访问属性 interFaceOrientation 认为存在@class BIDViewController。

如何访问这个。

4

1 回答 1

0

而不是调用属性更改如下在 viewWillApear 方法中检查方向如下

UIInterfaceOrientation orientation=[[UIApplication sharedApplication] statusBarOrientation];
[self willAnimateRotationToInterfaceOrientation:orientation duration:1];
于 2014-03-26T09:21:05.333 回答