RE: Multiple declarations for method length
RE: Multiple declarations for method length
- Subject: RE: Multiple declarations for method length
- From: "Jonathan E. Jackel" <email@hidden>
- Date: Tue, 30 Dec 2003 14:55:30 -0500
[(NSString *)myString length];
You also might check the declaration of myString. It may be id or obscured
somehow.
You can't "explicitly use the NSString length method." That's not how
Objective C works. Whether/how your objects respond to a selector is
determined at runtime. If your object is a string, it will respond to a
length message using NSString's method; if not, it either won't respond or
it will respond with its own implementation. The casting trick above gets
the compiler to shut up, but it won't change the nature of your object in a
running program.
Jonathan
>
-----Original Message-----
>
From: email@hidden
>
[mailto:email@hidden]On Behalf Of Jay Rimalrick
>
Sent: Tuesday, December 30, 2003 2:21 PM
>
To: email@hidden
>
Subject: Multiple declarations for method length
>
>
>
This is the warning I get when I compile my project.
>
>
For some reason it is getting confused between the NSStatusItem
>
length method and the NSString length method. Is there any way
>
to explicitly use the NSString length method in my code over and
>
above my simple [myString length];
>
>
>
thanks,
>
jay
>
>
>
>
>
________________________________________________________________
>
Sent via the WebMail system at 1st.net
>
_______________________________________________
>
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.
_______________________________________________
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.