• 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: Uli Kusterer <email@hidden>
  • Date: Wed, 28 Jun 2006 23:59:35 +0200

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: This email sent to email@hidden
  • Follow-Ups:
    • Re: Executing non objective-c code in a loaded bundle
      • From: Mark Williams <email@hidden>
References: 
 >Re: Executing non objective-c code in a loaded bundle (From: Damien Sorresso <email@hidden>)
 >Re: Executing non objective-c code in a loaded bundle (From: Chris Suter <email@hidden>)
 >Re: Executing non objective-c code in a loaded bundle (From: Mark Williams <email@hidden>)
 >Re: Executing non objective-c code in a loaded bundle (From: Pascal Pochet <email@hidden>)

  • Prev by Date: Re: Implementing a TCP port listener in Cocoa
  • Next by Date: Re: Login Item
  • 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