Of course you’d rather compare real world where the footprint of OSX is minimal. But in a contest where each OS has equal footing and equal opportunity to be targeted—no let’s not look at that.
OSX has avoided issues by being about as secure as Windows 7 and maintaining a small footprint on the world. However, as it grows so too will the hacks, malware, and viruses. As proven wiht the mac guard and defender malware.
It's nice that microsoft has finally managed, with Windows 7 to come close to the security provided out of the box years ago with OSX (or Linux for that matter). However, we've still not seen a self-propagating worm/virus in the wild that can attack OSX without serious user intervention. The fact that there are users out there stupid enough to allow some random site to install software on their computer, and provide their administrator password to do so, and give authorization for it to run, is hardly the fault of any operating system. I don't blame microsoft when a user downloads something off the web then proceeds to blindly install and run it when the program goes rogue. On the other hand, there are numerous examples of people running multiple versions of windows getting pwned by software that was was installed and executed with no user intervention whatsoever, or because they clicked on the wrong link.