저는 이것이 아주 기본적인 것이라고 생각합니다. 그러나 그것에 대해 아무 것도 찾을 수 없었습니다.델리게이트 설정
저는 viewController 마녀가 여러 개의 폼 시트 viewControllers가있는 navigationController에 대한 모달 세그를 가지고 있습니다. 이 같은
의 ViewController --- (모달 SEGUE)의 ViewController CI에서> C의 ViewController
이렇게, 대리인을 만들었다 --- --->있는 navigationController --->의 ViewController의 B :
@protocol ViewControllerCDelegate <NSObject>
- (void)myMehtod;
@end
@interface ViewControllerC : UIViewController
@property (nonatomic, assign) id <ViewControllerCDelegate> myDelegate;
(내가 합성 한 myDelegate)
내가 myDelegate가의 ViewController의 A. 내 질문은, 어디 내가 어떻게해야합니까로 설정하려는? 내가의 ViewController (A)의 viewDidLoad에이에에 노력했습니다
는 :
ViewControllerC *delegateController = [self.storyboard instantiateViewControllerWithIdentifier:@"ViewControllerC"];
delegateController.myDelegate = self;
하지만 대리자 설정 얻을 나타나지 않습니다. 아이디어?
'delegateController'가 실제로 인스턴스화되고 있습니까? 어딘가에 그 참조를 붙잡고 있니? –
위의 코드 세그먼트에서 참조하는 ViewControllerC의 인스턴스가 실제로 실제로 사용되는 인스턴스입니까? 즉, 다른보기 컨트롤러를 다른 곳에 인스턴스화하지 않는 것입니까? –
ViewControllerA가 제시 될 때가 아니라 ViewControllerC가 제시 될 때 델리게이트를 설정해야합니다. 그리고 myDelegate를 합성 할 필요는 없습니다. – AMayes