How to reverse a BOOL in Objective C

Sometimes you need the opposite of a BOOL. This is actually easier than I had expected –

  • the opposite of YES is !YES
  • and the opposite of NO is !NO.

More examples here:

Jay is the CEO and founder of WP Hosting, a boutique style managed WordPress hosting and support service. He has been working with Plesk since version 9 and is a qualified Parallels Automation Professional. In his spare time he likes to develop iOS apps and WordPress plugins, or draw on tablet devices. He blogs about his coding journey at and

Add your voice!