프로그램 Appdelegate에서 해제할 필요가 없는 특정 컨트롤러를 가져옵니다. 새로 만들지 않음 -----IOS
appdelegate의.h에서 @property(nonatomic,strong)CenterDrawerViewController*centerViewController1의 속성을 설명합니다.
.m에 새 self.centerViewController1 = [[CenterDrawerViewController alloc] init];
다음은 다른 컨트롤러에서 Appdelegate의centerViewController1을 받아야 합니다.
UIApplication* application = [UIApplication sharedApplication];
AppDelegate* appdelegate = application.delegate;
CenterDrawerViewController * centerViewController = appdelegate.centerViewController1;
이렇게 하는 장점은 우리 프로젝트에서 필요한 서랍 효과나 다른 페이지 전환 효과가 있을 때 이 페이지에서 다른 페이지로 전환하고 마지막에 원래의 페이지로 전환할 때이다.원래의 페이지는 새로 만들지 않아서 사용자의 일부 데이터를 절약할 수 있다.새로 만들기를 피했다.사용자는 드롭다운 새로 고침을 통해서만 새로 고침 기능을 터치할 수 있습니다.
하나의 해결 방법이지만 데이터 지속화(NSData와 압축 파일)를 이용하여 이 기능을 완성하는 것을 추천합니다. 이것은 임시변통의 방법일 뿐입니다. 재미만 있으면 실현해 보세요.
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
Swift의 패스트 패스Objective-C를 대체하기 위해 만들어졌지만 Xcode는 Objective-C 런타임 라이브러리를 사용하기 때문에 Swift와 함께 C, C++ 및 Objective-C를 컴파일할 수 있습니다. Xcode는 S...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.