This problem seems to be an Xcode bug which creeps up mostly when you replace a file with a new file of the same name. Xcode seems to keep a reference of the older file of the same name.
Anyhow, the way to fix this seems to be -
Clean the project
Click <Your Project> in Project Navigator view. Go to Compile Sources under Build Phases of the target for which you are building. Remove and add back the .m file which is giving you trouble.
Alternatively, in the File Inspector (Utilities view) of the NIB file, under Target Membership, uncheck and check back the target name.
Restart Xcode for good measure.
Of course, deleting and adding back the .m file alone should fix it too.
Steps 1. and 2. alone fixed it for me.
Feel free to ask if any step needs expanding.
Cheers and happy coding :)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…