Function calling
Function calling
- Subject: Function calling
- From: "Theodore H. Smith" <email@hidden>
- Date: Wed, 25 May 2005 22:58:10 +0100
I've noticed that functions that return (id), can have methods called
from them.
[item childAtIndex:index];
Here, item is actually an "id". And so we can't know what type of
object it is, or whether a childAtIndex method actually exists.
So, my question is, how does this work?
At runtime, an untyped object is about to be called, with a method
named "childAtIndex". OK, what information does the binary use to
figure out what is the actual function address to jump to? A list of
all "childAtIndex" methods in the compiled app?
I'm assuming Cocoa does not use some kind of string based hash table,
because that would be ridiculously slow.
Would strong typing speed things up? For example, is:
MyClassType* item = SomeSomeObj();
return [item childAtIndex:index];
faster than this?
id item;
return [item childAtIndex:index];
--
elfdata.com/plugin/ Industrial strength string processing, made easy.
"All things are logical. Putting free-will in the slot for premises in
a logical system, makes all of life both understandable, and free."
_______________________________________________
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