Re: Delayed Framework Loading
Re: Delayed Framework Loading
- Subject: Re: Delayed Framework Loading
- From: Dong Feng <email@hidden>
- Date: Sat, 13 Jun 2009 02:31:38 +0800
I tried the flag, but it seems make only the symbols weakly linked,
not delay the framework loaded. I test it by the following function in
my framework:
__attribute__((constructor))
static void MyModuleInitializer()
{
static initialized = 0;
if (!initialized)
{
// Initialization code.
initialized = 1;
}
}
int test_export()
{
return 112233;
}
and each time MyModuleInitializer() is invoked at launch time,
regardless how late test_export() is invoked.
2009/6/13 Jesper Storm Bache <email@hidden>:
> You'll probably want to look at:
> OTHER_LDFLAGS = -weak_framework SomeFramework
>
> Jesper Storm Bache
>
> ________________________________________
> From: cocoa-dev-bounces+jsbache=email@hidden [cocoa-dev-bounces+jsbache=email@hidden] On Behalf Of Dong Feng [email@hidden]
> Sent: Friday, June 12, 2009 8:23 AM
> To: email@hidden; Cocoa-dev Mailing List
> Subject: Delayed Framework Loading
>
> Is there a way to make a framework not loaded until the first
> invocation to one of its functions?
>
> I know there is a way, that is, to not link the framework to the
> executable, but use CFURLCreateWithFileSystemPath(). However, this
> way, you have to resolve all functions you are going to use one by one
> programmatically.
>
> In Visual C++ there is a compilation flag, /DELAYLOAD, to enable the
> delay load but still make all function resolving through .lib. Is
> there a similar thing in Xcode?
>
> Thank you.
>
_______________________________________________
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