Shouldn't spiedObject be also checked here? The key() call can return a nil value if the object got somehow deallocated without being cleaned up.