Re: NSString not working
Re: NSString not working
- Subject: Re: NSString not working
- From: Andy Lee <email@hidden>
- Date: Tue, 21 Apr 2009 00:40:23 -0400
On Apr 19, 2009, at 6:42 PM, Susan Granger wrote: I am unable to use NSString in my project. But if i try it in other new project it works fine. can any one help with this ?
char* tmp = "Blah";
NSString* str = [NSString stringWithCString:(const char*)tmp encoding:NSISOLatin1StringEncoding ];
After this, I get str = nil.
How do you know str is nil? Are you looking at it in the debugger? If you're using an NSLog, can you show us the NSLog statement?
Is this literally your EXACT code, or did you leave out or modify something?
What output do you get if you try the following?
NSLog(@"my C string is [%s] with length %d", tmp, strlen(tmp)); NSLog(@"my NSString is [%@]", str); NSLog(@"with UTF-8 I get [%@]", [NSString stringWithUTF8String:tmp]);
--Andy
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden