re: Problem in calling function of the loadable bundle!!!
re: Problem in calling function of the loadable bundle!!!
- Subject: re: Problem in calling function of the loadable bundle!!!
- From: George Warner <email@hidden>
- Date: Wed, 27 Apr 2005 09:56:02 -0700
On Wed, 27 Apr 2005 19:43:54 +0530, Jenis Shah <email@hidden> wrote:
> Hi all,
>
> I made a simple bundle which has just one function as below:
>
> void fun()
Shouldn't this return int?
> {
> static int i=0;
> return ++i;
Because you're trying to return one here.
> printf("The value of i is %d",i);
Oh, and a printf _AFTER_ you return? How's that supposed to work? ;-)
> }
Other than that, you should be checking all the return values. At the least
I'd add some "assert(NULL != bundleURL )", etc. For debugging I'd also
suggest "CFShow(bundleURL)", etc.
I also notice that you're using the POSIX path "/bundles/MyBundle.bundle".
That's an absolute location (leading slash); Do you have a bundles directory
in your system root directory? How is your bundle getting put there? Are you
copying it? Manually? If so that's a very error prone method. I couldn't
guess the number of times that I've tried to debug the wrong of an
executable because I forgot to copy it after I (re)built it. You're much
better off ether building it to the final location or creating a symbolic
link from the final location to your build folder. If your bundle (plugin?)
is supposed to be part of an application then you might consider using a
copy build phase on your application to copy the plug-in into its
"Contents/Frameworks" or "Contents/PlugIns" folder. Make sure that if you
build your plugin's (or frameworks) to work this way that their
"installation path" is set to "@executable_path/../Frameworks" (or PlugIns).
--
Enjoy,
George Warner,
Schizophrenic Optimization Scientist
Apple Developer Technical Support (DTS)
_______________________________________________
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