Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Objective-c > Q: nil and meth...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 960 of 1009
Post > Topic >>

Q: nil and method selection

by "G. Ralph Kuntz, MD, MS" <grk@[EMAIL PROTECTED] > Feb 29, 2008 at 06:30 AM

I was reading the latest language specification on Objective-C (2.0)
from Apple and came across something that confuses me with regard to
dynamic binding and typing.

If I create a new id and assign it the value nil like this:

    id x = nil;

then call some method on it,say "methodThatReturnsDouble" as in

    double y = [id methodThatReturnsDouble];

how does the runtime know which "methodThatReturnsDouble" I am
calling, since I could define it in more than one class?

Is this true in Smalltalk also?

Thanks, Ralph
 




 3 Posts in Topic:
Q: nil and method selection
"G. Ralph Kuntz, MD,  2008-02-29 06:30:04 
Re: Q: nil and method selection
Gregory Weston <uce@[E  2008-02-29 12:09:59 
Re: Q: nil and method selection
Greg Parker <gparker@[  2008-02-29 15:32:47 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 23:53:33 CDT 2008.