[問題] 函式讀不到/Not Fully implement??
最近剛開始學iPhone程式設計
但在開發的時候卻遇到許多難題
像是都照範例打但程式卻編譯不出來(我和網路上的環境都是SDK3)
像這樣
http://img829.imageshack.us/img829/5598/macosxleopard2010072222.png

因為我有在表頭檔中使用<UITableViewDataSource>
所以numberOfRowInSection 和 cellForRowAtIndexPath都必須去實作
(這樣說不知道對不對^^)
但遺憾的是在嘗試輸入這兩個方法時 會找不到這個方法
(顯示No completions Found)
http://img689.imageshack.us/img689/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
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
07/23 06:11, 3F
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 1 之 3 篇):
MacDev 近期熱門文章
PTT數位生活區 即時熱門文章