看板 [ MacDev ]
討論串[問題] override superclass init時會call的fun
共 2 篇文章
首頁
上一頁
1
下一頁
尾頁

推噓1(1推 0噓 1→)留言2則,0人參與, 最新作者ksksBangBang (Bang!)時間12年前 (2012/11/29 07:07), 編輯資訊
0
0
0
內容預覽:
既然你sample code都寫出來了 實驗看看就知道啦. 如果你在A的init中的[self xxx]丟一個breakpoint. 然後創建一個b. 就會發現即使你進到A的method裡 "self"永遠都還是B. 既然B override了A的xxx method. [self xxx]自然就是

推噓3(3推 0噓 2→)留言5則,0人參與, 最新作者wfgh (lyle)時間12年前 (2012/11/28 23:10), 編輯資訊
0
0
0
內容預覽:
如果我override superclass的init裡會call的method. 那[super init]時會call新的method還是原來的?. ex:. ClassA:NSObject. - (id)init. {. self = [super init];. [self xxx];. r
(還有82個字)
首頁
上一頁
1
下一頁
尾頁