Develop
2015.10.12 14:48

[ios] 상위 ViewController 가져오기

조회 수 960 추천 수 0 댓글 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
번호 분류 제목 글쓴이 날짜 조회 수
1029 Develop [swift] popToRoot 모달뷰, 네비게이션컨트롤러 한꺼번에 닫기 file hooni 2021.01.29 1388
1028 Develop [swift] NotificationCenter 간단 예제 file hooni 2021.01.27 8121
1027 System/OS [svn] 하나의 SVN에서 멀티 저장소 (One svnserve, multiple repositories) hooni 2015.01.02 1549
1026 Etc [svn] 콘솔에서 svn 사용시 레티나용 이미지 add 안될 때.. hooni 2013.09.25 37501
1025 System/OS [svn] SVN trunk 변경사항 되돌리기 (SVN Rollback) hooni 2014.11.27 1565
1024 System/OS [svn] Can't convert string from native encoding to 'UTF-8' 메시지가 나오는 경우 hooni 2014.12.18 993
1023 Database [sql] 한눈에 보이는 Join file hooni 2014.02.19 8466
1022 Database [sql] 쿼리로 문자열 검색해서 일괄 치환하기 hooni 2014.02.13 9973
1021 System/OS [sql] 중복데이터 삭제 쿼리 hooni 2013.04.23 14735
1020 System/OS [sql] 조회구문(select)에서 중복 데이터를 한 번만 출력 (distinct) 1 hooni 2013.04.23 33939
1019 System/OS [sql] 내 방명록 답글 찾는 쿼리문.. (JOIN 구문) hooni 2003.04.23 12845
1018 Database [sql] 간단한 통계 서브쿼리 예제.. hooni 2013.04.23 15088
1017 Database [sql] 간단한 SQL 문법 정리 hooni 2003.04.23 12551
1016 System/OS [sql] insert into select 사용하기 hooni 2013.04.23 27556
1015 System/OS [sql] alter table 쿼리 예제 hooni 2003.04.23 12459
1014 Develop [spring] 스프링 IoC/DI hooni 2013.04.23 11349
Board Pagination Prev 1 ... 8 9 10 11 12 ... 74 Next
/ 74