discuss-gnustep
[Top][All Lists]
Advanced

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

Re: Category for NSString not included?


From: Jonathan Bartlett
Subject: Re: Category for NSString not included?
Date: Mon, 27 Jun 2011 10:06:13 -0500

It's the standard gcc 4.1 on CentOS, so it is probably an older runtime.  When I built the latest GNUstep, it turned off exceptions, so that is probably the case.  Thanks!

Jon

On Mon, Jun 27, 2011 at 9:49 AM, David Chisnall <theraven@sucs.org> wrote:
On 26 Jun 2011, at 18:38, Jonathan Bartlett wrote:

> I have a category for NSString which defines a method "isEmpty".  However, I am getting the following error:
>
> GSCSubString (instance) does not recognize isEmpty.  Is this because this class is not inheriting from NSString, or something else?

Which Objective-C runtime are you using?  There was a bug with older versions of the GNUstep runtime which occasionally caused categories that were loaded before the classes to get lost.

GSCSubString is a(n indirect) subclass of NSString, so a category on NSString should be working.  If it isn't, then it's a bug in either your compiler or the runtime.  Can you send this message to other string objects?  What happens if you do this:

[class_createInstance(objc_getClass("NSString")) isEmpty];

David

-- Sent from my Apple II



reply via email to

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