Can work on iOS too

The code can work on a Mac app too.
It can be usefull to debug also.