bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re[2]: NSString / NSMutableString protocol


From: Richard Frith-Macdonald
Subject: Re: Re[2]: NSString / NSMutableString protocol
Date: Mon, 25 Mar 2002 14:25:54 +0000

On Monday, March 25, 2002, at 01:51 PM, ml@orange-concept.com wrote:

On Mon, 25 Mar 2002 13:30:40 +0000 Richard Frith-Macdonald <richard@brainstorm.co.uk> wrote:

|
| On Monday, March 25, 2002, at 01:11 PM, Manuel Guesdon ,
| MISSING_MAILBOX_TERMINATOR@.SYNTAX-ERROR wrote:
|
| > Hi,
| >
| > When compiling GNUstepWeb which CVS current version, I get:
| >         derived_src/GSWeb/GSWDynamicURLString.h:32: Cannot find
| > protocol declaration for `NSMutableString'
| > GSWUtils.m:55: Cannot find protocol declaration for `NSString'
| >
| > It seems that NSString && NSMutableString protocol have disappeared.
| >
| > How can I replace the use of them ?
|
| Just write whatever protocols you want.
|
| If you are wanting to test to see if an object is a string ... use
| isKindOfClass:

That's what I've done to work but isKindOfClass: won't work for non NSString objects which where implementing NSString protocol. The only solution I see is to use respondsToSelector: for methods I'd like to call. Do you see another one ?

If you are only using one or two methods, the respondsToSelector: solution is good. If you really have non-string objects which conform to the old NSString protocol, and want to use lots of NSString methods, you should write a protocol containing the methods you want to use and have the objects conform to it.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]