Re: Cocoa Bundle and weak-linking
Re: Cocoa Bundle and weak-linking
- Subject: Re: Cocoa Bundle and weak-linking
- From: The Karl Adam <email@hidden>
- Date: Fri, 28 Jan 2005 11:34:35 -0500
Weak linking requires you add -weak_framework [insert framework here]
that you want to weak link to. However that isn't the problem here.
This seems to be that your using NSSearchField directly instead of
indirectly NSClassFromString(). If you use
NSClassFromString(@"NSSearchField") you can use the class returned to
instantiate an instance if it doesn't return nil. nil tells you the
class doesn't exist and that your on Jaguar, getting a value back
means it does and your on a post jaguar OS.
-Karl
On Fri, 28 Jan 2005 17:24:06 +0100, Jerome Foucher
<email@hidden> wrote:
> Hi list,
>
> I'm running into a strange problem:
> My app is carbon-based, but uses Cocoa bundles to display some windows.
> In one of these Cocoa windows, I have implemented s search field. But because my app is 10.2 compatible, the search field is created at runtime. I check if the OS version : if it's 10.3 I create a NSSearchField and if it's 10.2, a NSTextField
>
> But that doesn't seem to be sufficient, as when loading the Cocoa bundle on 10.2, the app crashes telling the bundle tried to create a NSSearchField ! It just looks like the bundle was not weak-linked....
>
> So, do I have to do anything special in XCode or in my code so that the bundle is "weak-linked" ?
>
> Thanks,
> Jérome
> _______________________________________________
> 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
>
_______________________________________________
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