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: Mark Williams <email@hidden>
- Date: Wed, 28 Jun 2006 20:49:10 -0700
Thanks to both of you for this information.
I'll be working on it and I think with this information I should be
able to get this working. Thanks very much :)
Mark.
On Jun 28, 2006, at 2:59 PM, Uli Kusterer wrote:
Am 28.06.2006 um 22:23 schrieb Pascal Pochet:
make an URL from the POSIX path to your bundle
CFURLRef bundleURL = CFURLCreateWithFileSystemPath
(CFAllocatorGetDefault(),
ABSOLUTE_PATH_TO_YOUR_BUNDLE_AS_CFSTRINGREF,
kCFURLPOSIXPathStyle, NO) ;
BTW -- CFURLRef and NSURL* are toll-free bridged, so if you have
an NSURL*, you can just cast it to a CFURLRef. Same applies to
CFStringRef and NSString*.
to call the function:
(*FUNCTION_VAR)( PARAMS );
BTW - C lets you get away without dereferencing FUNCTION_VAR. So,
if you want to, you can write
FUNCTION_VAR( ... );
and thus call a dynamically loaded function just like a static one
if you put its pointer in a global or "file-global" static
variable. Useful if you have a library that gets loaded when it is
present, but without which you can do (like Growl, for instance, or
a library to talk to some hardware that's only there if that
additional hardware is installed). You can write the code without
all those additional asterisks and brackets.
Cheers,
-- M. Uli Kusterer
http://www.zathras.de
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40fornextsoft.com
This email sent to 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