通知機制是多對多的,代理是一對一的
在監聽者中的回調函數裏,默認已經是把整個通知傳遞給了回調函數,只要函數默默加上冒號就可以收到NSNotification
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillChangeFrame:) name:UIKeyboardWillChangeFrameNotification object:nil];
name:表示名字 object:哪個對象的name
UIDevice類提供了一個單例對象
UIDeviceOrientationDidChangeNotification旋轉設備之類的
對象銷燬時dealloc裏面一定要有有removeObserver,要與addObserver匹配
CGRectValue
transform是相對於最開始來說的