Contents

Develop
2015.10.12 14:48

[ios] 상위 ViewController 가져오기

조회 수 945 댓글 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
번호 분류 제목 글쓴이 날짜 조회 수
757 Develop [ios] 구분자로 문자열 자르기 (split) hooni 2013.04.23 26269
756 Develop [node.js] nodejs 기본 설치 hooni 2013.04.23 26250
755 Develop [python] DJI Tello 드론 코딩 (프로그래밍) 58 file hooni 2018.03.04 25721
754 Develop GCM 사용하기 3 (JSP로 GCM 푸시 서버 만들기) 4 file hooni 2013.07.06 25315
753 Develop [c#] 웹문서 소스(html) 긁어오기 file hooni 2013.04.23 24504
752 Develop [c++] MD5 구현 소스.. 퍼움.. file hooni 2013.04.23 24068
751 Develop [ios] 아이폰 개발 총정리.. file hooni 2013.04.23 23861
750 Develop [pdf] GPS의 동작 원리 ㅎㅎ file hooni 2013.04.23 23830
749 Develop [c] 다중연결 서버 만들기 #4 - thread 사용 file hooni 2013.04.23 23701
748 Develop [c#] 비동기 통신 샘플 코드 ㅎㅎ file hooni 2013.04.23 23631
747 Develop GCM 사용하기 2 (단말에 GCM 구현하기) file hooni 2013.07.06 23248
746 Develop [ios] UIColor 지정에서 RGB define ㅎㅎ hooni 2013.04.23 22912
Board Pagination Prev 1 ... 3 4 5 6 7 8 9 10 11 12 ... 71 Next
/ 71