Solution which worked for me is.
My project is in Objective-c and i selected the .m file (which is giving error) and from File Inspector i checked the target. it works!
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: