시스템 메서드 호출 순서 인쇄 노트 ------

4800 단어
A 컨트롤러 push에서 B 컨트롤러로 pop하는 과정
4+(void) initialize 및 4+(void)load이 두 가지 방법은 파일에 따라 불러오는 것이다. 가장 최근에 호출된 방법이다. 모든 파일이 있고 한 번만 호출된다. 그 다음에 컨트롤러의 생명주기가 있다. 이것은 실제 장면(코드를 쓰지 않아도 상상에 의존)을 결합시켜야 더욱 잘 이해할 수 있다.
2017-08-17 13:58:39.673     [7919:2276898] ViewController---->+[ViewController initialize]
2017-08-17 13:58:39.685     [7919:2276898] ViewController---->+[ViewController load]
2017-08-17 13:58:39.686     [7919:2276898] TwoViewController---->+[TwoViewController initialize]
2017-08-17 13:58:39.687     [7919:2276898] TwoViewController---->+[TwoViewController load]
2017-08-17 13:58:39.889     [7919:2276898] ViewController---->-[ViewController loadView]
2017-08-17 13:58:39.889     [7919:2276898] ViewController---->-[ViewController viewDidLoad]
2017-08-17 13:58:39.890     [7919:2276898] ViewController---->-[ViewController viewWillAppear:]
2017-08-17 13:58:39.892     [7919:2276898] ViewController---->-[ViewController viewWillLayoutSubviews]
2017-08-17 13:58:39.893     [7919:2276898] ViewController---->-[ViewController viewDidLayoutSubviews]
2017-08-17 13:58:39.897     [7919:2276898] ViewController---->-[ViewController viewDidAppear:]
2017-08-17 13:58:42.000     [7919:2276898] ViewController---->-[ViewController viewWillDisappear:]
2017-08-17 13:58:42.001     [7919:2276898] TwoViewController---->-[TwoViewController loadView]
2017-08-17 13:58:42.001     [7919:2276898] TwoViewController---->-[TwoViewController viewDidLoad]
2017-08-17 13:58:42.001     [7919:2276898] TwoViewController---->-[TwoViewController viewWillAppear:]
2017-08-17 13:58:42.116     [7919:2276898] TwoViewController---->-[TwoViewController viewWillLayoutSubviews]
2017-08-17 13:58:42.116     [7919:2276898] TwoViewController---->-[TwoViewController viewDidLayoutSubviews]
2017-08-17 13:58:42.116     [7919:2276898] TwoViewController---->-[TwoViewController viewWillLayoutSubviews]
2017-08-17 13:58:42.116     [7919:2276898] TwoViewController---->-[TwoViewController viewDidLayoutSubviews]
2017-08-17 13:58:42.620     [7919:2276898] ViewController---->-[ViewController viewDidDisappear:]
2017-08-17 13:58:42.620     [7919:2276898] TwoViewController---->-[TwoViewController viewDidAppear:]
2017-08-17 13:58:43.495     [7919:2276898] TwoViewController---->-[TwoViewController viewWillDisappear:]
2017-08-17 13:58:43.495     [7919:2276898] ViewController---->-[ViewController viewWillAppear:]
2017-08-17 13:58:43.998     [7919:2276898] TwoViewController---->-[TwoViewController viewDidDisappear:]
2017-08-17 13:58:43.998     [7919:2276898] ViewController---->-[ViewController viewDidAppear:]
2017-08-17 13:58:43.999     [7919:2276898] TwoViewController---->-[TwoViewController dealloc]

코드 작성(-initWthFrame:) 컨트롤러에 UIView 객체를 추가하여 표시하는 프로세스
2017-08-17 14:08:50.952     [7970:2281341] DemoView---->+[DemoView initialize]
2017-08-17 14:08:50.955     [7970:2281341] DemoView---->+[DemoView load]
2017-08-17 14:08:50.956     [7970:2281341] TwoViewController---->+[TwoViewController initialize]
2017-08-17 14:08:50.957     [7970:2281341] TwoViewController---->+[TwoViewController load]
2017-08-17 14:08:51.159     [7970:2281341] DemoView---->-[DemoView initWithFrame:]
2017-08-17 14:08:51.159     [7970:2281341] DemoView---->-[DemoView willMoveToSuperview:]
2017-08-17 14:08:51.160     [7970:2281341] DemoView---->-[DemoView willMoveToWindow:]
2017-08-17 14:08:51.161     [7970:2281341] DemoView---->-[DemoView didMoveToWindow]
2017-08-17 14:08:51.163     [7970:2281341] DemoView---->-[DemoView layoutSubviews]
2017-08-17 14:08:51.164     [7970:2281341] DemoView---->-[DemoView drawRect:]


하나의 대상을 실례화하고Category를 이용하여 하나의 대상의setter와 Getter를 연결하여 하나의 방법을 호출한 다음에 호출 순서가 이렇다. 먼저 set을 호출한 다음에 인쇄 방법을 호출하고 인쇄 방법에서 get을 호출한다.
2017-08-17 14:26:10.586     [8082:2288947] Person---->+[Person(Category) initialize]
2017-08-17 14:26:10.588     [8082:2288947] Person---->+[Person load]
2017-08-17 14:26:10.588     [8082:2288947] TwoViewController---->+[TwoViewController initialize]
2017-08-17 14:26:10.589     [8082:2288947] TwoViewController---->+[TwoViewController load]
2017-08-17 14:26:10.589     [8082:2288947] Person---->+[Person(Category) load]
2017-08-17 14:26:10.774     [8082:2288947] Person---->-[Person init]
2017-08-17 14:26:10.774     [8082:2288947] Person---->-[Person(Category) setCardID:]
2017-08-17 14:26:10.774     [8082:2288947] Person---->-[Person(Category) logIDMessage]
2017-08-17 14:26:10.775     [8082:2288947] Person---->-[Person(Category) cardID]
2017-08-17 14:26:10.775     [8082:2288947] 
      : wgb 
      : man 
      : 25  
        : 36073419930510XXXX    

좋은 웹페이지 즐겨찾기