The [[CTCallCenter alloc] init] must be run in the main queue. Is it thread safe ??? Better call it on main thread only.

There is an iOS bug that causes instances of the CTCallCenter class to sometimes get notifications after they have been deallocated. Instead of instantiating, using, and releasing instances you must instead retain and never release them to work around the bug.

Not all iOS devices have proximity sensors. To determine if proximity monitoring is available, attempt to enable it. If the value of the proximityMonitoringEnabled property remains NO, proximity monitoring is not available.

Assert is to make sure a value is what its supposed to be. If an assertion fails that means something went wrong and so the app quits.

It is important to make sure that there is no data loss in any such situation.

Note that XCode 4 has NS_BLOCK_ASSERTIONS defined by default in release configurations. I guess if you don’t change that your released code will not contain NSAsserts. So, just put the macro in your distribution target [only].

NSAssert (and its stdlib equivalent Assert) can be very useful for debugging/unit testing, and also when you provide frameworks to stop the users from doing “evil” things. So not only does it safe-guard against potentially bad inputs but it logs them in a useful, standard way.

Assertions are commonly used to enforce the intended use of a particular method or piece of logic. They enforce that your code is used only as intended.

The value that’s passed is entered by the user, you need to do proper validation of the input rather than relying on the assertion. A user entering a value that is not allowed should be followed by a UI error, not NSAssert crashing the application.

NSAssert is to throw an exception, which you can catch and handle (try/catch).