Contents

Develop
2015.10.12 14:48

[ios] 상위 ViewController 가져오기

조회 수 956 댓글 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
번호 분류 제목 글쓴이 날짜 조회 수
1005 Etc ISMS 인증기준 – 정보보호대책 (시스템개발보안) file hooni 2016.12.01 1309
1004 System/OS [mac] Mac OS 패키지 매니저, HomeBrew file hooni 2015.01.03 1316
1003 Develop [php] 한글 문자열 자르기 (utf-8) hooni 2015.11.10 1319
1002 PPT [ppt] 전자금융보안론 발표/설치 자료 file hooni 2016.05.03 1324
1001 Develop [android] 간단한 SQLIite 예제 hooni 2017.06.14 1325
1000 System/OS 네트워크 용어 정리 file hooni 2022.11.20 1327
999 Develop How to Test SMTP AUTH using Telnet hooni 2018.04.05 1335
998 System/OS RPA란? 어디에 어떻게 쓰이고 누가 만드나? file hooni 2020.01.28 1357
997 Develop [ios] How to set up clang formatter hooni 2015.09.17 1360
996 Develop [swift] popToRoot 모달뷰, 네비게이션컨트롤러 한꺼번에 닫기 file hooni 2021.01.29 1383
995 System/OS SSH Passwordless Login Using SSH Keygen in 5 Easy Steps file hooni 2019.11.22 1390
994 Develop [ios] Swift 4 String, Date, DateFormatter 예제 hooni 2018.10.18 1397
Board Pagination Prev 1 ... 10 11 12 13 14 15 16 17 18 19 ... 98 Next
/ 98