teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

3

修正

2015/12/17 14:57

投稿

_Kentarou
_Kentarou

スコア8490

answer CHANGED
@@ -1,10 +1,14 @@
1
1
  新規のプロジェクトのViewControllerにソースを貼り付けてエラー無くテーブルが表示できました。
2
2
  ※Storyboardの変更無し
3
3
 
4
- Xcode7.2です。
4
+ こちらの環境はXcode7.2 Swift2.1.1 です。
5
5
 
6
6
 
7
- swiftのバージョンが2.0で無ければキャストが必要かもしれません。
7
+ swiftのバージョンが古い場合キャストが必要かもしれません。
8
8
  ```swift
9
9
  var cell = tableView.dequeueReusableCellWithIdentifier("MyCell", forIndexPath: indexPath) as UITableViewCell
10
+
11
+ or
12
+
13
+ var cell = tableView.dequeueReusableCellWithIdentifier("MyCell", forIndexPath: indexPath) as! UITableViewCell
10
14
  ```

2

修正

2015/12/17 14:57

投稿

_Kentarou
_Kentarou

スコア8490

answer CHANGED
@@ -1,4 +1,10 @@
1
1
  新規のプロジェクトのViewControllerにソースを貼り付けてエラー無くテーブルが表示できました。
2
2
  ※Storyboardの変更無し
3
3
 
4
- Xcode7.2です。
4
+ Xcode7.2です。
5
+
6
+
7
+ swiftのバージョンが2.0で無ければキャストが必要かもしれません。
8
+ ```swift
9
+ var cell = tableView.dequeueReusableCellWithIdentifier("MyCell", forIndexPath: indexPath) as UITableViewCell
10
+ ```

1

修正

2015/12/17 14:48

投稿

_Kentarou
_Kentarou

スコア8490

answer CHANGED
@@ -1,3 +1,4 @@
1
- 新規のプロジェクトにソースを貼り付けてエラー無く表示できました。
1
+ 新規のプロジェクトのViewControllerにソースを貼り付けてエラー無くテーブルが表示できました。
2
+ ※Storyboardの変更無し
2
3
 
3
- 試してみてください、このコード以外の問題かと思います。
4
+ Xcode7.2です。