之前 addObserver 是寫在 initWithNibName

程式執行的很順利

現在多加了一個檔案也想用一樣的寫法結果卻不行了?!

找了一陣子才發現原來我新加入的檔案不是用 nib 載入而是使用 Storyboard

難怪看半天看不出問題...

後來把 addObserver 移到 initWithCoder 就ok了

 

 

 這篇參考資料雖然做法不好, 但給了我靈感!

Notification Observer is not catching the post

arrow
arrow
    全站熱搜

    JohnDX 發表在 痞客邦 留言(0) 人氣()