Contents

Develop
2015.10.12 14:48

[ios] 상위 ViewController 가져오기

조회 수 953 댓글 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
번호 분류 제목 글쓴이 날짜 조회 수
177 Develop [c++] 더블 링크리스트(linked list) 학습용 초간단 단어장 file hooni 2003.04.23 9323
176 Develop [c] OpenGL 직사각형(2D) 크기 확대/축소 hooni 2003.04.23 9069
175 Develop [jsp] 정적/동적(차트생성) 이미지 전달 file hooni 2003.04.23 7307
174 Develop [c] 프로세스간의 통신(파이프) hooni 2003.04.23 6891
173 Develop [c] 구조체의 설명과 예제.. hooni 2003.04.23 8373
172 Develop [c] 포인터와 함수포인터에 대해.. hooni 2003.04.23 8019
171 Develop [c] 스토리지 클래스(변수) hooni 2003.04.23 8197
170 Develop [c] 시간 관련 함수 설명과 예제.. file hooni 2003.04.23 11523
169 Develop [c] 문자열 처리 관련 함수들 설명 hooni 2003.04.23 7997
168 Develop [linux] 프로세스 관련 시스템콜 hooni 2003.04.23 7827
167 Develop [c] 시간 계산 하는 프로그램 소스코드 file hooni 2003.04.23 6745
166 Develop [php] 마시마로 캐릭터 방명록 file hooni 2003.04.23 8239
Board Pagination Prev 1 ... 79 80 81 82 83 84 85 86 87 88 ... 98 Next
/ 98