import UIKit
class ListViewController: UITableViewController, XMLParserDelegate {
var paraser:XMLParser!
var items = Item
var item:Item?
var currentString = ""
override func tableView(_ tabale: UITableView,numberOfRowsInSection section: Int) -> Int {return items.count } override func tableView(_ tableView:UITableView,cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "Cell",for: indexPath) cell .textLabel?.text = items[indexPath.row].title return cell } override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) startDownload() }
func startDownload() {
self.items = []
if let url = URL(
string: "https://wired.jp/rssfeeder/"){
if let parser = XMLParser(contentsOf: url) {
self.parser = parser
self.parser.delegate = self
self.parser.parse()
}
}
}
Ambiguous use of 'parser'
Ambiguous reference to member 'parser(_:didStartElement:namespaceURI:qualifiedName:attributes:)'
Ambiguous reference to member 'parser(_:didStartElement:namespaceURI:qualifiedName:attributes:)'
このようなエラーが出ますなぜでしょうか?