"- (void)viewDidLoad"에서 "UIViewController"를 띄우려고 하면 아래와 같은 경고가 발생하며, 제대로 나오지 않는다.
Warning: Attempt to present <PolarisViewController: 0x79656d00> on <ViewController: 0x7974f270> whose view is not in the window hierarchy! |
뷰가 완성되지 않은 상태에서 띄우려고 하여 경고 발생.
"- (void)viewDidAppear:(BOOL)animated"에서 띄우면 정상동작한다.
- (void)viewDidAppear:(BOOL)animated
{
//스토리보드의 ViewController 호출
UIViewController* vc = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"ViewController"];
[self presentViewController:vc animated:YES completion:nil];
}
'Object-C > 팁' 카테고리의 다른 글
레티나 단말 확인 방법 (0) | 2015.04.07 |
---|---|
4inch 모델에서 앱에 검은 여백이 생길때 (0) | 2015.04.03 |
터치 좌표를 이용한 각도 구하는 법 (0) | 2014.12.24 |
GMT offset 알기 (0) | 2014.12.03 |
소스파일 ARC 사용/미사용 적용 (0) | 2014.10.24 |