exception occur NSPlaceholderString initwithstring:] nil argument on snow leapord and on leapord exception occur but alert does not come.
You get an exception telling you you passed a nil
argument because you passed a nil
argument.
The string you passed there was nil
. This has nothing to do with the encoding of the string, for two reasons:
- There is no string. (If you had passed a string, you would not have passed
nil
.)
- Strings do not have encoding; they are simply character strings. Encodings get you from human-language characters (in strings) to sequences of bytes (in data).
Moreover, if you had a string to pass to initWithString:
, you would not need to create a string using initWithString:
, because you already have the string. If you wanted to copy it, you could simply send it a copy
message.
We don't know what you do already have, which is vitally important. Please edit your question to include the code that gets the “string” out of the database or from the XML parser and passes it to initWithString:
.
Is It only due to 'é', means I want to know if NSString does not supported 'é' or any other characters
NSString supports all of the characters in Unicode. To a practical extent, this means all of them.