Re: Executing non objective-c code in a loaded bundle
Re: Executing non objective-c code in a loaded bundle
- Subject: Re: Executing non objective-c code in a loaded bundle
- From: Jonathon Mah <email@hidden>
- Date: Wed, 28 Jun 2006 14:58:09 +0930
Hi Mark,
On 2006-06-28, at 14:11, Mark Williams wrote:
I have a bundle with a couple of plain old C functions in it. When
I load it I have no trouble executing any objective-c code but I do
not know how to execute a regular c function from the loaded bundle
like somefunction(); Is it possible to do this or do I have to
convert it all to obj-c?
If you only have a few, you could wrap them in an Objective-C class,
otherwise you'll probably have to use CFBundle as Stephen suggested.
@interface MyWrapper : NSObject
+ (int)cFunc:(float)arg1 :(char)arg2;
@end
@implementation MyWrapper
+ (int)cFunc:(float)arg1 :(char)arg2
{
return real_cfunc(arg1, arg2);
}
@end
Jonathon Mah
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden