Apple has published the source code for the open source component of Mac OS X 10.7.4.
Sources are published under various licenses: APSL, BSD, GPL, LGPL, Apache and others.
You can find and study here
www.opensource.apple.com/release/mac-os-x-1074')
Remember that your final products that use the source code of the applications,
should also
should be desirable to publish open source!