• 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: weak linking questions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: weak linking questions


  • Subject: Re: weak linking questions
  • From: Aurélien Hugelé <email@hidden>
  • Date: Wed, 26 May 2004 01:09:30 +0200

On 25 May 2004, at 23:46, Aurilien Hugeli wrote:

hi list !

i would like to add some details i think i have understood now...

i've succeeded to make my application jaguar compatible using the weak
linking feature. The app ran on jaguar perfectly.
I don't know what did i changed, or what did i misunderstood because
now it does not work anymore on jaguar, saying that NSMutableIndexSet
is not in Cocoa (this class is panther only...)

all my project/targets are correctly set to "Mac OS X deployment target
: 10.2", in deployment, and i can see this setting/flag in the build
log...

i have checked using nm -mg and ALL my symbols are hard linked :(

i've of course cleaned everything... no way

so here is my question, because i feel i misunderstood something :
if i implement something like this :
NSMutableIndexSet *aSet = [[NSMutableIndexSet alloc] init];
AND is in deployment target 10.2 AND is in deployment build, any call
to a weak symbol on jaguar should return NULL ok ?
so NSMutableIndexSet *aSet = [[NSMutableIndexSet alloc] init]; should
do "nothing" (but should not crash !)

am i wrong ?

this is were i think the problem is... in fact the weak linking do not work as i expect : it works for simple C function or C object type, but it does not work for ObjC classes ... am i wrong on this point ? weak linking does not work for "complex" objC selector... that's why
NSMutableIndexSet *aSet = [[NSMutableIndexSet alloc] init] is not weak linked ???



i basically found a hack on cocoa-faq, but i insist on the fact that i DID NOT NEED this hack about 6h ago, when weak linking seemed to work !!! the hack is : Class mutableIndexSetClass = NSClassFromString(@"NSMutableIndexSet"); id indexesSet = [mutableIndexSetClass indexSet];

it basically works... the app launch on jaguar... and now i have
exception like this :
[NSScrollView setAutohidesScrollers:] selector not recognized... of
course i know it is panther only, but should n't it do nothing since
setAutohidesScrollers should be NULL because of weak linking ?

[read addtions above]

What may have i done to break weak linking (i'm pretty sure i did not modify anything in my project/targets setting) is there a bug with weak linking ??

thanks a lot for any help of people that master weak linking :D

so *must* i use the hack described above ? must i *always* use respondsToSelector: when using 10.3 selector of 10.3 objects ?
(of course i already use respondsToSelector with 10.3 selector on *10.2* objects) ?


thanks !

_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.


References: 
 >weak linking questions (From: Aurélien Hugelé <email@hidden>)

  • Prev by Date: Re: Code completion of member functions / attributes?
  • Next by Date: Re: weak linking questions
  • Previous by thread: weak linking questions
  • Next by thread: Re: weak linking questions
  • Index(es):
    • Date
    • Thread