How to set an OSX application dock icon in XCode?
===

So far the only working solution I have found is to use:

    [NSApp setApplicationIconImage: myImage];

But this message is sent after the default icon is already in the dock, so it's not working: so icon is initially the default application icon. I have not found the correct place to send this message.

I have read this: http://stackoverflow.com/questions/6337787 but it seems a bit too old to be useful for XCode 4.3

What is the standard way to set the dock icon, and even more importantly, where in the documentation is this described ?