Re: Building a C library Objective-C wrapper framework
Re: Building a C library Objective-C wrapper framework
- Subject: Re: Building a C library Objective-C wrapper framework
- From: Sebastian Nowicki <email@hidden>
- Date: Tue, 15 Jul 2008 15:11:12 +0800
On 14/07/2008, at 11:30 PM, Jens Alfke wrote:
On 14 Jul '08, at 2:00 AM, Sebastian Nowicki wrote:
What happens is that I try to #import <MyFramework/MyFramework.h>,
and gcc complains that it can't find theclib.h. "theclib.h" is
found in MyFramework/Headers/theclib.h, but it's of course only
looking in the default header search paths.
Ideally, your framework should hide the C library by not #including
its header from its own public headers. Which means not using any
types defined by that library in your headers. It's usually possible
to do this, but it can get a little tricky sometimes.
Hmm, the way I currently have it is that MyFramework.h simply imports
the various public headers of the classes (I just looked at
Foundation.h and copied Apple's method). The class headers sometimes
contain types from the c library, at least as member variables. I
guess I'd have to make a category in the .m file to hide it... that
should work :). I'll see how that goes. Thanks.
Oh, a problem I'll probably run into is that the c library defines
some enums, which are exposed in the public header files. How would I
abstract that? A typedef doesn't work, so I guess I'd have to define
my own enum and just set the values to those of the other enum? Quite
an ugly solution, imo.Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden