[問題] 函式讀不到/Not Fully implement??

看板MacDev作者 (KaKa)時間15年前 (2010/07/22 22:49), 編輯推噓1(102)
留言3則, 3人參與, 最新討論串1/3 (看更多)
最近剛開始學iPhone程式設計 但在開發的時候卻遇到許多難題 像是都照範例打但程式卻編譯不出來(我和網路上的環境都是SDK3) 像這樣 http://img829.imageshack.us/img829/5598/macosxleopard2010072222.png
因為我有在表頭檔中使用<UITableViewDataSource> 所以numberOfRowInSection 和 cellForRowAtIndexPath都必須去實作 (這樣說不知道對不對^^) 但遺憾的是在嘗試輸入這兩個方法時 會找不到這個方法 (顯示No completions Found) http://img689.imageshack.us/img689/5598/macosxleopard2010072222.png
http://img708.imageshack.us/img708/5598/macosxleopard2010072222.png
所以程式就無法編譯成功了 但非常奇特的是把範例的程式碼貼到我的程式裡卻又可以WORK了(已檢查過都一模一樣) 研究了很久卻不知道為什麼這樣 請問各位高手有遇到類似的問題或是知道為什麼嗎? 謝謝 ////////程式資訊 .H檔 #import <UIKit/UIKit.h> @interface Simple_TableViewController : UIViewController <UITableViewDelegate, UITableViewDataSource> { NSArray *listData; } @property (nonatomic, retain) NSArray *listData; @end .M檔 http://www.mgt.ncu.edu.tw/~inzaghi0507/123.rar 太多字用附檔^^ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.115.218.135

07/23 00:15, , 1F
請不要改參數的名字 照著protocol定的寫
07/23 00:15, 1F

07/23 00:54, , 2F
不好意思請問參數是指?
07/23 00:54, 2F
我去查這裡 http://0rz.tw/c4ZPS tableView:numberOfRowsInSection: -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection: (NSInteger)section tableView:cellForRowAtIndexPath: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath: (NSIndexPath *)indexPath 都一模一樣欸 剛學搞不太清楚 請問參數是指這個嗎? ※ 編輯: inzaghi0507 來自: 140.115.218.135 (07/23 02:38)

07/23 06:11, , 3F
剛開始我都是把查到的用法,copy & paste貼到.m裡面....
07/23 06:11, 3F
文章代碼(AID): #1CI5fvxs (MacDev)
文章代碼(AID): #1CI5fvxs (MacDev)