Suddenly it stops building application in device. In simulator its working but when I connect the device and try to run it in device it gives me an error:
I accidentally edited the Foundation framework file
so UIKit.framework got corrupted. The only solution is recover the original.
You have two solutions: Just reinstall XCode or copy the Framework from another machine with the same XCode version and paste into yours.
Location:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks