Contents

Develop
2015.10.12 14:48

[ios] 상위 ViewController 가져오기

조회 수 2841 댓글 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
번호 분류 제목 글쓴이 날짜 조회 수
601 Develop [c++] 채팅로봇 소스.. ㅋㄷㅋㄷ file hooni 2013.04.23 9788
600 Develop [c] 지나가는 패킷 잡기 hooni 2003.04.23 9773
599 Develop [c] fgets() 함수 사용하기.. hooni 2003.04.23 9746
598 Develop [c] 압축 알고리즘 소스 및 정리 file hooni 2013.04.23 9731
597 Develop [c] 레포트용으로 제출했던 여러 소스코드 모음 file hooni 2003.04.23 9727
596 Develop [c] 숫자(int, Number)를 hex코드로 변환하는 소스 file hooni 2013.04.23 9723
595 Develop [js] 스크롤을 포함한 마우스 위치 찾는 코드 hooni 2003.04.23 9723
594 Develop [c] UCP/TCP 채팅 소스 - 정리해야 함.. file hooni 2003.04.23 9722
593 Develop [c++] 레지스트리 등록 예제 1 file hooni 2013.04.23 9721
592 Develop [js] 초간단 암호화/복호화 소스.. hooni 2003.04.23 9718
591 Develop [php] php+db 연동(odbc, mssql, mysql, sybase) 3 hooni 2013.04.23 9694
590 Develop [css] 화면 스크롤 제어 ㅋㅋ hooni 2003.04.23 9689
Board Pagination Prev 1 ... 44 45 46 47 48 49 50 51 52 53 ... 99 Next
/ 99