Contents

Develop
2015.10.12 14:48

[ios] 상위 ViewController 가져오기

조회 수 1150 댓글 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
번호 분류 제목 글쓴이 날짜 조회 수
129 PPT [ppt] 정보보호관리 발표내용 file hooni 2016.11.30 1171
128 Etc RSVP 란? file hooni 2017.11.22 1169
127 PPT [ppt] 정보보호관리 발표내용 #2 file hooni 2016.12.08 1169
126 System/OS [mac] VirtualBox 실행 스크립트와 bash_profile 설정 file hooni 2020.07.08 1165
125 Develop [ios] Did UIScrollView End Scrolling? hooni 2016.04.19 1159
124 System/OS [mac] OS X 엘 캐피탄에서 Soudflower 사용하기 2 file hooni 2016.10.03 1157
123 System/OS [mac] Homebrew/rvm/cocoapod setting hooni 2017.07.29 1155
122 Etc 캘리포니아 운전면허 문제 file hooni 2017.07.22 1154
» Develop [ios] 상위 ViewController 가져오기 hooni 2015.10.12 1150
120 PPT [ppt] iOS 플라랩#03(2015.04.27) 발표 자료 file hooni 2015.04.24 1147
119 Develop [ios] StoryBoard(xib) 없이 프로젝트 만들기 file hooni 2015.02.12 1146
118 System/OS [svn] Can't convert string from native encoding to 'UTF-8' 메시지가 나오는 경우 hooni 2014.12.18 1139
Board Pagination Prev 1 ... 83 84 85 86 87 88 89 90 91 92 ... 98 Next
/ 98