I am new to Swift and was trying some tutorials to learn and polish my knowledge on Swift. I stumbled upon above error in this code which I didn't understand. In case anyone of you have idea, please explain whats wrong here.
let textChoices = [
ORKTextChoice(text: "Create a ResearchKit app", value:0),
ORKTextChoice(text: "Seek the Holy grail", value:1),
ORKTextChoice(text: "Find a shrubbery", value:2)
]
I resolved the error by suggestion provided by Xcode and now my code looks like
let textChoices = [
ORKTextChoice(text: "Create a ResearchKit app", value:0 as NSCoding & NSCopying & NSObjectProtocol),
ORKTextChoice(text: "Seek the Holy grail", value:1 as NSCoding & NSCopying & NSObjectProtocol),
ORKTextChoice(text: "Find a shrubbery", value:2 as NSCoding & NSCopying & NSObjectProtocol)
]
There is another solution I got from answer. While it works, I am still not clear about the problem and solution. What is the concept I am missing.