2012年11月2日 星期五

[iOS] CS193P 2011 Fall Lesson Two


  • All the outlet only needs to be weak, 因為會綁在 view下, 而 view always strong
  • control + 滑鼠來 link view與 viewController
  • 搞清楚 action與 IBOutlet
    • action: view的部分, 使用者接觸或做了什麼事, 來通知 viewController, 所以像是 OnClicked
    • IBOutlet: viewController需要 view做什麼改變的橋梁
  • id: pointer to any (unknown) type
  • debug:
    • NSLog:
      • 很像 printf
      • sample: NSLog(@"The digit you pressed is %@", digit);
      • 你也可以使用 %d: integer, %g: floating number等等, 而 %@是針對 object, 其會呼叫 [digit description] 來顯示
  • 快速搜尋文件
    • option+滑鼠至於 method上
  • wrapper
    • NSNumber
      • wrap primitive data type into object
  • synthesize never allocate, only for pointer

沒有留言:

張貼留言