Would you have any example to show the use of context? I've always wondered why I should use context so this would not only educate me but others that are like me: clueless about context ;)
You also could use [object class] instead of an arbitrary static pointer.
I never had issue with a class and a subclass using the same observer keypath. Whenever I use it I always call super to make sure everything underneath is called. But that's a good thing to know for sure, thanks.
If you look at the Key Value Observing Protocol you will find two methods that allow you to remove an observer again (remember: You have to remove an observer at the appropriate time - otherwise you will receive exceptions and your app will probably crash):
removeObserver:forKeyPath: and removeObserver:forKeyPath:context:. The first one has been around forever but it does not allow you to specify a context - only an observer and a path. This is problematic and andrewsardone gave you an example. This is why Apple introduced the second method in 10.7/iOS 5 which allows you to specify a (unique) context. The documentation says:
"Examining the value in context you are able to determine precisely which addObserver:forKeyPath:options:context: invocation was used to create the observation relationship. When the same observer is registered for the same key-path multiple times, but with different context pointers, an application can determine specifically which object to stop observing."
Always specifying a context makes your app more robust.
I then forgot to say I couldn't read the post since the site was down:( I will read it when it gets back online.
He is registering an observer without using a context. If you remove the observer without specifying a context then bad things can happen if two observers do the same. For this reason there is a new method for this in 10.7 and this fact should have been mentioned because so many people have wasted so many hours debugging KVO.