I'd like to access Cocoa-API's (Foundation, AppKit) from Mathematica and have researched the following ways:
CocoaLink: A deprecated Package by Rob Schlofield from 2009, which is still available on GitHub but will not compile out of the box due to the introduced changes in the ObjC-Runtime made at that time and around 2010. I got it to work, but not for all Types. I contacted Rob if he will update CocoaLink but he told me that the effort would not justify the usefulness ... unfortunately.
MonoObjC: A Mono/.NET package which can be installed and used after Mono has been installed. Mono allows one to use .NETLink and invoke almost all .NET functions of the 4.0 Framework.
I have tried:
Needs["NETLink`"]; monobjc = LoadNETAssembly["Monobjc"]; foundation = LoadNETAssembly["Monobjc.Foundation"]; appkit = LoadNETAssembly["Monobjc.AppKit"];
Then I tried to load and instantiate a NSString but it failed with Messages telling me that the Bridge to ObjC is not available.
nsstring = LoadNETType["Monobjc.Foundation.NSString"]; sstr = NETNew[nsstring]
NET::netexcptn: A .NET exception occurred: System.TypeInitializationException: An exception was thrown by the type initializer for Monobjc.Foundation.NSString ---> System.TypeInitializationException: An exception was thrown by the type initializer for Monobjc.ObjectiveCRuntime ---> System.EntryPointNotFoundException: monobjc_install_bridge .....
I am not sure if there is more to be done to initialize .NETLink when working with other external mono packages.