Re: NSString initWithBytes
Re: NSString initWithBytes
- Subject: Re: NSString initWithBytes
- From: Gregory Weston <email@hidden>
- Date: Fri, 2 Sep 2005 07:07:35 -0400
Koen van der Drift wrote:
I am using the following code to convert a char to an NSString:
aString = [[NSString alloc] initWithBytes: &aChar length: 1 encoding:
NSUTF8StringEncoding];
However, the compiler gives a warning that initWithBytes cannot be
found. I am using OS X 10.4. (and yes, I have added #import
<Foundation/Foundation.h> to the header file ;-)
Any ideas why I get the warning, the method is documented in the
developer docs, and it even works as it is supposed to.
It's documented in the developer docs and is declared without any
conditionalization in NSString.h (and I use it in something I've been
rebuilding daily for the last week without getting warnings).
Ideas:
1. You say you've imported Foundation.h in your head file...have have
imported your header file into your implementation file?
2. Is the code snippet above actually cut-and-pasted from your
source, or retyped? (i.e. Is it possibly you've spelled or
capitalized the method name wrong?)
G
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden