Re: [問題] 有關customed table cell 的 作法
※ 引述《Gsus (肉元,吉米,助教)》之銘言:
: ※ 引述《zonble (zonble)》之銘言:
: : 因為他要用 Interface builder 來 customize table view cell
: 我是在想說應該也是能夠用
: ProductTableCell *cell = [[ProductTableCell alloc] initWithNib..];
: 為什麼要用load nib file這種指令來做?
: 是有效能上的優點還是只是個人選擇而已呢?
因為 initWithNibName:bundle: 是 UIViewController 的 method
ProductTableCell 繼承自 UITableViewCell,並沒有這個 method
: 請問一下這裡的retain是
: [NSBundle mainBundle] loadNibFile:@"...]
: load nib file後就自動retain了嗎?
你可以看一下 header 裡頭的 property 的定義,IBOutlet 是要 retain 的
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.42.189.204
※ 編輯: zonble 來自: 114.42.189.204 (07/15 20:28)
討論串 (同標題文章)
MacDev 近期熱門文章
PTT數位生活區 即時熱門文章