跳到主要內容

發表文章

目前顯示的是 8月, 2018的文章

Objective-C extern

extern  下面的代碼聲明了一個全局變量,它用於告訴編譯器:“你現在編譯的文件中,有一個標識符雖然沒有在本文件中定義,但是它是在別的文件中定義的全局變量,你要在其它文件內查找!” #define ANIMATION_DURATION 0.5 // 替换成 static const NSTimeInterval kAnimationDuration = 0.5; // 全局常量 // QiShare.h extern const NSTimeInterval QiShareAnimationDuration; // QiShare.m const NSTimeInterval QiShareAnimationDuration = 0.3;

Print log in swift

Swift has  #file ,  #function ,  #line  and  #column . From  Swift Programming Language : #file  - String - The name of the file in which it appears. #line  - Int - The line number on which it appears. #column  - Int - The column number in which it begins. #function  - String - The name of the declaration in which it appears. 下log用。

View-Related Notifications in ViewController

A viewcontroller push b viewController B loadView() B viewDidLoad() A viewWillDisappear B viewWillAppear B viewWillLayoutSubviews() B viewDidLayoutSubviews() A viewDidDisappear B viewDidAppear B vc back to A vc B viewWillDisappear A viewWillAppear B viewDidDisappear A viewDidAppear 從來沒認真過這個順序,考過之後,才發現跟認知有點距離。我應該也背不下來。XD