discuss-gnustep
[Top][All Lists]
Advanced

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

Re: NSString subclass responsibility


From: Fred Kiefer
Subject: Re: NSString subclass responsibility
Date: Sun, 24 Mar 2024 18:04:16 +0100

I was hoping for somebody else to answer this. There are different subclasses 
that provide the implementation for NSString, most importantly GSString. Within 
an Obj-C application NSString in itself is never instantiated. The problem you 
are facing is that your non Obj-C code may try to instantiate an NSString 
object. Just stick to the [[NSString alloc] initXXXX] pattern or get your 
strings from one of the factory methods.

Hope this helps,
Fred

> Am 23.03.2024 um 20:03 schrieb Boris D. <borisd@gmx.com>:
> 
> Hello,
> In NSString.m, -length is defined as follows:
> 
> - (NSUInteger) length
> {
>   [self subclassResponsibility: _cmd];
>   return 0;
> }
> 
> My code links with the gnustep-base library but is not compiled from
> Objective-C source. Am I supposed to use a subclass of NSString instead
> of NSString directly? Which class provides this implementation?
> 
> 




reply via email to

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