• 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: Multiple declarations for method length
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Multiple declarations for method length


  • Subject: Re: Multiple declarations for method length
  • From: lbland <email@hidden>
  • Date: Tue, 30 Dec 2003 17:22:29 -0500

On Dec 30, 2003, at 4:40 PM, Ken Ferry wrote:

Is myString declared as an id? If so, the compiler doesn't know which
one you want, although the runtime will invoke the correct one. You
can eliminate the warning by either declaring or casting myString as a
NSString*.

This is actually not true. Objective-C is more dynamic that other object oriented languages, and the code that executes is always determined at runtime.

hum, I see nothing wrong with the first statement, nor the 2nd.

What I do find less than desirable is the use of the method "length" to return float v.s. unsigned. It would have been nicer to name the methods more precisely to eliminate the name conflict. If "length" returned double (or other 64 bit) then that could really create problems without casting.

In the old days (before casting was introduced into obj-c) this really created some problems and the only way to get around it was to import only specific header files so there was no name conflict.

-lance

Lance Bland
mailto:email@hidden
VVI
888-VVI-PLOT
http://www.vvi.com
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >RE: Multiple declarations for method length (From: "Jonathan E. Jackel" <email@hidden>)
 >Re: Multiple declarations for method length (From: Ken Ferry <email@hidden>)

  • Prev by Date: create new folder
  • Next by Date: Re: create new folder
  • Previous by thread: Re: Multiple declarations for method length
  • Next by thread: Re: Multiple declarations for method length
  • Index(es):
    • Date
    • Thread