[問題] 新手請問UItableView的用法
之前沒寫過UItableView,
這幾天第一次嘗試的時候卻一直碰到瓶頸。
照著網路上的資料一步步實作卻一直無法成功顯示出text,
在網路上找了好久仍然找不到原因及方法,
以下是我的程式碼
#import "NextViewController.h"
@implementation NextViewController
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:\
(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"any\
-cell"];
if (cell == nil)
{
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentif\
ier:@"any-cell"] autorelease];
}
cell.textLabel.text = @"test";
return cell;
}
@end
一開始我是使用cell.setText來處理,但是OS 3.0後好像就不能使用了,
於是改用cell.textLable.text,可以執行但是卻無法顯示,
一直無法找出原因,
可以請提醒我哪個部份的觀念有錯誤嗎?
謝謝。
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.32.236.106
→
10/06 02:21, , 1F
10/06 02:21, 1F
→
10/06 02:28, , 2F
10/06 02:28, 2F
→
10/06 02:28, , 3F
10/06 02:28, 3F
→
10/06 02:37, , 4F
10/06 02:37, 4F
→
10/06 02:37, , 5F
10/06 02:37, 5F
推
10/06 07:57, , 6F
10/06 07:57, 6F
→
10/06 07:57, , 7F
10/06 07:57, 7F
推
10/07 07:14, , 8F
10/07 07:14, 8F
→
10/07 07:15, , 9F
10/07 07:15, 9F
→
10/07 23:55, , 10F
10/07 23:55, 10F
→
10/07 23:55, , 11F
10/07 23:55, 11F
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 1 之 2 篇):
MacDev 近期熱門文章
PTT數位生活區 即時熱門文章