Contents

Develop
2015.10.12 14:48

[ios] 상위 ViewController 가져오기

조회 수 960 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

상위 ViewController 가져오기

 

UIViewController *vc;

vc = (UIViewController*)[btn.superview nextResponder];

vc = (UIViewController*)[view.superview nextResponder];

 

nextResponder

Returns the receiver'€™s next responder, or nil if it has none.

- (UIResponder *)nextResponder
Return Value

The next object in the responder chain to be presented with an event for handling.

Discussion

The UIResponder class does not store or set the next responder automatically, instead returning nil by default. Subclasses must override this method to set the next responder. UIViewimplements this method by returning the UIViewController object that manages it (if it has one) or its superview (if it doesn’t); UIViewController implements the method by returning its view’s superview; UIWindow returns the application object, and UIApplication returns nil.

Availability
  • Available in iOS 2.0 and later.
Declared In

UIResponder.h 


?

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
781 Develop [c] 가위 바위 보 서버, 클라이언트 소스코드 file hooni 2003.04.23 8178
780 Develop [c] fork() 시스템 콜 사용 방법. hooni 2003.04.23 27590
779 Develop [c] 소켓 프로그래밍 요약.. hooni 2003.04.23 6971
778 Develop [c] 소켓주소 구조체에 대해.. hooni 2003.04.23 6731
777 Develop [c] 소켓의 세가지 동작모드 hooni 2003.04.23 6911
776 Develop [c] 컴파일러 DFA구현^^ 입력 받아 실행 4 file hooni 2003.04.23 8112
775 Develop [c] OpenGL 시어핀스키 가스킷(p.73 - 첫시간) hooni 2003.04.23 8756
774 Develop [c] 시어핀스키 가스킷..(p.582, A.2 - 두번째) hooni 2003.04.23 7481
773 Develop [c] 약수/최대공약수/완전수 알고리즘 hooni 2003.04.23 8869
772 Develop [c] 프로그래밍의 전반적인 설명 ppt file hooni 2003.04.23 7675
771 Develop [jsp] HelloServlet 출력문 file hooni 2003.04.23 7796
770 Develop [jsp] Get방식, Post방식 전송 예제.. file hooni 2003.04.23 13764
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 71 Next
/ 71