I just created one new cordova ios project via CLI, and i opened that project in Xcode 7.1 and while running on simulator am getting some error on mainViewController.xib, if
Super specific but one of compile-time errors that can cause this is putting the keyword 'optional' before a function in a non-objc protocol.
Close project from File menu and Reopen the project again, the issue is gone.
Yesterday I had this problem too. I remember I've had it before 1 year too and I remember how to fix it. The reason for the error (in my case) was an error in the code in AppDelegate. Sometimes errors in AppDelegate are the reason for this behaviour of xCode. So if You want to fix it, first try commenting Your code in AppDelegate function by function, until you find the function with the error. Once you find it start uncommenting piece by piece the code in that particular function until you see which code line is breaking everything. Believe me ... This will save you lots of time searching the internet.
I have deleted XCode 7.1 and installed XCode 7.0.1.
http://developer.apple.com/devcenter/download.action?path=/Developer_Tools/Xcode_7.0.1/Xcode_7.0.1.dmg
This solved the problem.
I changed Xcode - Preferences - Text Editing, ticked on 'Code Folding Ribbon' and 'Focus code blocks on hover'.
Cleaned the project and it removed the source editing error.