Usually resetting the network settings will work in Settings<General<Reset<Reset Network Settings, if it does not, you can try to reset all settings in that area. This will not delete anyhting off of your iPhone, it just may move some apps around and change your background and small things like that. If your issue continues and you still cannot see your iMac on your iPhone, try restarting your computer as well as closing all running applications on the iPhone (Double-Tap the Home Button, Hold on bottom application until they start move and tap on the red minus signs in the top left of each app on the bottom bar) and restarting your iPhone as well.
If the issue STILL continues after this and you can prove it is not an issue with the bluetooth on your computer, then I would restore the iPhone as new on a computer with iTunes, making sure to sync all of your information to somewhere first.