• 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: Dynamic message typing problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dynamic message typing problem


  • Subject: Re: Dynamic message typing problem
  • From: Scott Ribe <email@hidden>
  • Date: Fri, 16 May 2008 15:52:33 -0600
  • Thread-topic: Dynamic message typing problem

> ...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@hidden
http://www.killerbytes.com/
(303) 722-0567 voice


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: Dynamic message typing problem (From: Julius Guzy <email@hidden>)

  • Prev by Date: Core Data, SQL stores, and predicate restrictions
  • Next by Date: Re: Dynamic message typing problem
  • Previous by thread: Re: Dynamic message typing problem
  • Next by thread: Re: Dynamic message typing problem
  • Index(es):
    • Date
    • Thread