標籤:
1.IBAction:
1> 能保證方法可以連線
2> 相當於void
2.IBOutlet:
1> 能保證屬性可以連線
3.常見錯誤
setValue:forUndefinedKey:]: this class is not key value coding
錯誤原因是:連線出問題了
4.Xcode5開始的一些建議
把用於連線的一些方法和屬性聲明在.m檔案的類擴充中,保證其封裝性。
5.frame\center\bounds
1> frame:能修改位置和尺寸
2> center:能修改位置
3> bounds:能修改尺寸(x\y一般都是0)
6.NSBundle
1> 一個NSBundle代表一個檔案夾,利用NSBundle能訪問對應的檔案夾
2> 利用mainBundle就可以訪問軟體資源套件中的任何資源
3> 模擬器應用程式的安裝路徑
/Users/aplle/資產庫/Application Support/iPhone Simulator/7.1/Applications
7.UIImageView和UIButton
1> 使用場合
* UIImageView: 如果僅僅是顯示圖片,不需要監聽圖片的點擊
* UIButton: 既要顯示圖片,又要監聽圖片的點擊
2> 相同:能顯示圖片
3> 不同點
* UIButton能處理點擊事件, UIImageView不能處理點擊事件
* UIButton既能顯示圖片, 又能顯示文字
* UIButton能同時顯示兩張圖片
* UIButton繼承自UIControl, 因此預設就能處理事件
* UIImageView繼承自UIView, 因此預設就不能處理事件
8.Xcode文檔安裝路徑
/Applications/Xcode.app/Contents/Developer/Documentation/DocSets
9.Xcode模擬器安裝路徑
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs
iOS--小結系列一