• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Executing non objective-c code in a loaded bundle
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >Executing non objective-c code in a loaded bundle (From: Mark Williams <email@hidden>)

  • Prev by Date: Re: Executing non objective-c code in a loaded bundle
  • Next by Date: Re: Executing non objective-c code in a loaded bundle
  • Previous by thread: Re: Executing non objective-c code in a loaded bundle
  • Next by thread: Re: Executing non objective-c code in a loaded bundle
  • Index(es):
    • Date
    • Thread