[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Category for NSString not included?
From: |
David Chisnall |
Subject: |
Re: Category for NSString not included? |
Date: |
Mon, 27 Jun 2011 15:49:43 +0100 |
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