Jos*_*erg 5 cocoa-touch objective-c interface-builder nib ipad
我正在尝试在iPad应用程序中支持多个方向,而设计者提出的视图无法使用纯粹的弹簧/支柱模型进行设置.我已经在两个单独的nib文件中布局了视图,目前使用以下...
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation duration:(NSTimeInterval)duration;
{
if (UIInterfaceOrientationIsPortrait(interfaceOrientation))
{
[[NSBundle mainBundle] loadNibNamed:@"ConfigureViewController-Portrait" owner:self options:nil];
}
else
{
[[NSBundle mainBundle] loadNibNamed:@"ConfigureViewController" owner:self options:nil];
}
}
Run Code Online (Sandbox Code Playgroud)
这是有效的,但正如预期的那样,有点慢.有没有办法缓存这个结果?或者是否有某种方法可以完成我缺少的整个过程.只是拿着从它回来的顶级对象并没有什么帮助,因为我需要NIB知道如何连接所有东西.