TimerViewController
이라는 사용자 정의보기 컨트롤러와 FirstViewController
및 FourthViewController
이라는 서브 클래스가 있습니다.NSLogging UILabel의 텍스트 출력이 null입니다.
FirstViewController
의 인스턴스를 FirstViewController
의 .
에 controller
으로 선언했습니다. FourthViewController
의 .m
의 viewDidLoad
방법에서
controller = [self.storyboard instantiateViewControllerWithIdentifier:@"mainController"];
, 나는 mainController
로 뷰 컨트롤러 ID를 선언 FourthViewController
의 사용자 정의 클래스를 선언했습니다. 그런 다음, FourthViewController
의 .m
에서 내가 가진 :
controller.mainLab.text = [NSMutableString stringWithFormat:@"This is a string"];
NSLog(@"%@", controller.mainLab.text);
이, 그러나, 출력 (null)
.
왜 이런 일이 발생합니까?
mainLab에 로그인하면 어떻게됩니까? – rdelmar
여전히 얻을 수 있습니다 (null) – user1626438
mainLab이란 무엇입니까? IBOutlet입니까? 이 코드가있는 컨트롤러와 같은 컨트롤러에 있습니까? – rdelmar