"how to create a icns icon programmatically?" Code Answer
5
you can use iconfamily.
iconfamily is a cocoa/objective-c wrapper for the mac os x carbon
api's "icon family" data type. its main purpose is to enable cocoa
applications to easily create custom file icons from nsimage
instances, and thus take advantage of mac os x's high-resolution rgba
"thumbnail" icon formats to provide richly detailed thumbnail previews
of the files' contents.
you can use iconfamily.