2012-08-16 4 views
1

최근 Storyboard에서 XIB로 변환되었습니다. 많은 수의보기가 있기 때문에 git 저장소를 통해 XIB를 사용하는 것이 더 쉽습니다. (또한 iOS 4에서도 앱을 사용할 수 있습니다.) 하지만 XIBs와,스토리 보드 -> XIB | 로드보기

지금 여기에 내가 가지고하는 데 사용되는 코드입니다,하지만 난 스토리 보드없이 동일한 달성 얼마나 궁금 :

UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:[NSBundle bundleForClass:[self class]]]; 
infoView *infoViewController = [storyboard instantiateViewControllerWithIdentifier:[defaults objectForKey:@"launchScreen"]]; 
infoViewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; 
[self presentViewController:infoViewController animated:YES completion:nil]; 

답변

2

먼저 infoView.xib에 스토리 보드에서 infoView을 변환해야합니다, 그 다음 :

infoView *infoViewController = [[infoView alloc]initWithNibName:@"infoView" bundle:nil]; 
    infoViewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; 
    [self presentViewController:infoViewController animated:YES completion:nil];