Re: including xibs from another project
Re: including xibs from another project
- Subject: Re: including xibs from another project
- From: Roland King <email@hidden>
- Date: Thu, 21 Jan 2010 00:27:57 +0800
hm ok - that makes more sense but .. how does otool know what class it is? It certainly seems to, the output has the class type annotated (ok I was using ocx not straight otool but surely that means the information about class type is there somewhere and the linker should be able to figure that out too).
On 21-Jan-2010, at 12:19 AM, Jonas Maebe wrote:
>
> On 20 Jan 2010, at 16:47, Roland King wrote:
>
>> ok this makes some sense, there's lots of ways in which I can see dynamic resolution of classes or methods isn't known at link time, KVO, methods composed from strings, I would not expect a linker to figure that out. But that's not where we are in this example, it's a little more direct than that, there's a class Foo and if you call
>>
>> [ Foo anyMethod ]
>>
>> all the code for Foo gets linked in
>
> That's because the compiler has to pass a reference to the Foo class information as target parameter to the objc_msgSend() function. Hence, the linker knows that it has to link in Foo.
>
>> but if you call
>>
>> [ foo anyInstanceMethod ]
>>
>> where foo is explicitly defined to be a Foo*, it doesn't link it in.
>
> In this case, the target parameter of objc_msgSend() is simply the variable "foo". At the assembler/machine code level, there is no information whatsoever about what that variable's type is (it's just a random memory location), and hence the linker does not know anything about it (even if you enable debug info, because the debug info does not explicitly reference the class information; it rather partially duplicates that info and primarily relies on the debugger to look up most things at run time using reflection).
>
>
> Jonas
> _______________________________________________
> 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
_______________________________________________
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