Re: Calling a Cocoa library from C
Re: Calling a Cocoa library from C
- Subject: Re: Calling a Cocoa library from C
- From: Kyle Sluder <email@hidden>
- Date: Mon, 14 Nov 2011 10:05:57 -0800
On Nov 14, 2011, at 9:47 AM, Nathan Sims <email@hidden> wrote:
> The help so far has been very edifying.
>
> Now, I go to create a 'Cocoa Library' project in Xcode 3.2.6, and it generates a libaaa.h and a libaaa.m for me. But in the .m file, there's an '@implementation libaaa' line. I'm confused, I thought a Cocoa library was a number of *.o (compiled .m files) archived into a single file with a transfer vector table at the front. I'm unclear on what its expecting me to put in the libaaa.m '@implementation' area. Do I ignore it? libaaa.a isn't a class, so why does it have an @implementation?
The template assumes your library is going to vend Objective-C classes to apps that link against it. If all you really need is for your library to be able to call ObjC methods, just delete the @implementation and @interface.
FWIW, Objective-C isn't magic. When you compile Objective-C code, be it functions, classes, or whatever, it boils down to functions and symbols in an object file just like regular C code.
--Kyle Sluder_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden