Xcode 5 DP4 (iOS 7 プロジェクト) で新しいプロジェクトを作成しました。プロトタイプ セル 1 つを使用して、ストーリー ボードに Table View Controller を配置しました。次に、テーブル デリゲートにコードを追加しました。こんな感じ
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
UILabel *mylabel = [[UILabel alloc] initWithFrame:CGRectMake(35,13, 230, 30)];
[cell.contentView addSubview:mylabel];
mylabel.text = @"Hello";
return cell;
}
これは期待どおりに機能しています。私が行ったように、新しいプロジェクトでコードを分離しようとしましたか? 問題は、貼り付けた実際のコードとは無関係である可能性があります。