私は練習としてSwiftコードをObjective-Cに変換しています。 ViewController.mError: "TableItem *"タイプのオブジェクトに "count"プロパティが見つかりません
で
- (NSInteger) tableView: (UITableView *) tableView numberOfRowsInSection:(NSInteger)section {
return self.items[section].count;
}
エラー:プロパティ "表項目*" 型のオブジェクトに見つからない "カウント"
オリジナルスウィフトコード:
override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return items[section].count
}
Viewcontroller.swift
class ViewController: UITableViewController {
let now = NSDate()
var date = NSDate()
var sections:[String] = []
var items:[[TableItem]] = []
...
が必要ですか? 'items'はどのように定義されていますか? – Wain
'items'の宣言はどこですか? – garanda
self.items.countである必要があります。 –