Re: Initializing a string with an NSData
Re: Initializing a string with an NSData
- Subject: Re: Initializing a string with an NSData
- From: Fritz Anderson <email@hidden>
- Date: Fri, 29 Jun 2001 17:40:10 -0500
At 6:57 PM +0200 6/29/2001, Candide Kemmler wrote:
- (id)initWithData:(NSData *)data
encoding:(NSStringEncoding)encoding
Problem is: I don't know how to create a valid NSStringEncoding...
NSStringEncoding is defined near the head of NSString.h as being an
unsigned integer. There follows a list of constants identifying the
encodings.
You can dig this up by typing the symbol "NSStringEncoding" into a
source file in your (indexed) project, and command-double-clicking on
it. You could also type the symbol into Cocoa Help; the
documentation under types and constants is "forthcoming," but the
constant list appears about 15% of the way into the NSString
(Objective-C) page.
BTW, I'm looking for
a good introduction to Objective-C for a non-C programmer (I'm a Java
programmer). Don't really know how to handle the * thing (pointers...).
The consensus seems to be that there is no such introduction. Most
people think it might be hard to teach Objective-C without teaching C
first.
Are you _sure_ Java will not suit your project? It seems to me that
learning Cocoa and C at the same time will leave you in continual
doubt whether your bugs are Cocoa-related or C-related.
-- F