Skip navigation.
 
mlRe: Dynamic message typing problem
FROM : Scott Ribe
DATE : Fri May 16 23:52:33 2008

> ...if the method
> name is unique, the types of the parameters are determined.


Not unless a declaration is visible. Your reasoning is that there's no other
printFloat: so the compiler should know, but this is still (sort of) C--if
you don't include a declaration that tells the compiler what the parameter
types are, it doesn't know. In other words, it ain't C# or Java, it depends
on those .h files ;-)

> Any idea where I should look to find ways of correcting this code?


You need to have a declaration of printFloat visible where it is called. Any
declaration of printFloat, not necessarily the one in the anonymous class:
that one, or one in a base class, or a category, or a protocol.

Also, you need to make sure that all instances of the printFloat: method are
declared the same. OK, that is not ***100% strictly required***, but having
a printFloat: in one class that takes a float, and one in another class that
takes a different kind of argument, is ***not*** an easy thing to deal with.

--
Scott Ribe
<email_removed>
http://www.killerbytes.com/
(303) 722-0567 voice

Related mailsAuthorDate
mlDynamic message typing problem Julius Guzy May 15, 03:19
mlRe: Dynamic message typing problem Michael Vannorsdel May 15, 13:41
mlRe: Dynamic message typing problem Julius Guzy May 16, 17:21
mlRe: Dynamic message typing problem Michael Vannorsdel May 16, 18:12
mlRe: Dynamic message typing problem Julius Guzy May 16, 19:13
mlRe: Dynamic message typing problem Scott Ribe May 16, 20:11
mlRe: Dynamic message typing problem Julius Guzy May 16, 23:17
mlRe: Dynamic message typing problem Bill Bumgarner May 16, 23:34
mlRe: Dynamic message typing problem Scott Ribe May 16, 23:52
mlRe: Dynamic message typing problem Michael Vannorsdel May 17, 00:06
mlRe: Dynamic message typing problem Scott Ribe May 17, 00:39
mlRe: Dynamic message typing problem I. Savant May 17, 01:05
mlRe: Dynamic message typing problem Julius Guzy May 17, 01:51
mlRe: Dynamic message typing problem Bill Bumgarner May 17, 01:58
mlRe: Dynamic message typing problem Jens Alfke May 17, 02:11
mlRe: Dynamic message typing problem I. Savant May 17, 02:21
mlRe: Dynamic message typing problem Julius Guzy May 17, 13:55
mlRe: Dynamic message typing problem Michael Vannorsdel May 17, 15:40