I deleted my project (by mistake) from the mac. before that i debug the app on my device. So, is there any way to extract my code from the device?
How can i extract ipa from the device?
Short answer: no. If you don't have a backup, your code is gone for good.
Prior to iOS 9 it was possible to copy .ipa files from the device. But now, with app thinning, iTunes no longer backs up app binaries. I'm not sure you can get an .ipa from the device now. But even if you could, that's the compiled binary, not your source code. Yes it would contain any other assets (images or other supporting files) but not your code.