第一關我新的iOS開發所以這可能是一個簡單的問題,的UITableViewController不會顯示單元格即時通訊創造
我有下面的代碼
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 1;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] ;
cell.textLabel.text = @"Hello!";
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
NSLog(@"Creating cell for %i:%i", indexPath.section, indexPath.row);
return cell;
}
現在表所示,但所有的行都是空白的。細胞正在被創造。不知道它是否重要,但我不使用xib或故事板,所以我不知道它是否是一個樣式問題。
我真的在這裏什麼即時通訊做的黑暗。我試着遵循一些教程,每次我都會在空白桌子的同一個地方結束。
謝謝所有幫助!我打開思路和可能的教程等
0是啊,我得到創建單元:0。或者,如果我設置第1和行3,那麼我得到: 創建細胞爲0:1 創建爲0電池:2 0創建細胞。 TIL:計算器意見不支持新線 – kjones1876