Re: [問題] iPhone: navigation template

看板MacDev作者 (狗狗)時間14年前 (2011/05/29 15:33), 編輯推噓2(203)
留言5則, 3人參與, 最新討論串4/4 (看更多)
※ 引述《freedom76912 (KHAKI)》之銘言: : 感謝各位的回答 不過我de了很久還是無法>"< : 附上兩個程式檔(都短短的而以) : 希望能有先進幫忙解惑一下 是否犯了什麼致命的錯誤而不自知 : http://mpac.ee.ntu.edu.tw/~freedom76912/RootViewController.m : http://mpac.ee.ntu.edu.tw/~freedom76912/DrinkDetailViewController.m : 感謝<(_ _)> DrinkDetailViewController.m - (void)dealloc { [nameTextField dealloc]; [ingredientsTextView dealloc]; [directionsTextView dealloc]; [drink dealloc]; [super dealloc]; } 應該是 - (void)dealloc { [nameTextField release]; [ingredientsTextView release]; [directionsTextView release]; [drink release]; [super dealloc]; } dealloc內是release你有retained過的property吧? 你的header file呢?@property有宣告成為retain嗎? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 223.138.217.152

05/29 15:39, , 1F
我在header file裡面都是宣告成retain耶@@
05/29 15:39, 1F

05/29 15:40, , 2F
很好奇你在-dealloc內去dealloc你的property是哪邊學的
05/29 15:40, 2F

05/29 15:41, , 3F
通常教retain的同時都會教release吧? 囧rz
05/29 15:41, 3F

05/29 15:43, , 4F
Head First...
05/29 15:43, 4F

05/29 17:02, , 5F
哈哈,原來是這樣XDDD
05/29 17:02, 5F
文章代碼(AID): #1DuVR9lf (MacDev)
文章代碼(AID): #1DuVR9lf (MacDev)