tika tika - 1 year ago 114
iOS Question

iOS Swift Error - Objective C method ... provided by method

What does this error mean? This code compiled fine previous week. I noticed that when I change

func parser
func something
, there are no compilation errors, but the method, obviously, does not work at runtime and shows no output.

Any ideas?

enter image description here

**ERROR :** Objective-C method
provided by method
conflicts with optional requirement method
'parser(_:didStartElement:namespaceURI:qualifiedName:attributes:)' in
protocol 'NSXMLParserDelegate'

Answer Source

If you look at the docs or the headers, you will see how to declare this method:

func parser(parser: NSXMLParser,
 didStartElement elementName: String,
    namespaceURI namespaceURI: String?,
   qualifiedName qualifiedName: String?,
      attributes attributeDict: [NSObject : AnyObject])

As you can see, those types are very different from the types you are using. You need to fix yours so they match these exactly.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download