Search code examples
iphoneobjective-cioscocoa-touchcore-text

ASCII Value for Plain Space in Objective C / iPhone


I'm trying to find the correct ASCII value for a plain space in Objective C / iPhone. Basically, I'm in a situation where @" " won't cut it because CoreText is not recognizing it (see my other question for more info). When I use the following:

[self.delegate insertText: @"\u00A0"];

The problem I'm having goes away, however I get the unintended side effect of having to use a non breaking space. I've tried using 0020 as this what is listed in the ASCII table as a plain space, however I get a complaint from the compiler: "Invalid universal character"

Anyone have any ideas of what I could insert here?


Solution

  • @" " is a plain space. Your other question does not in any way indicate otherwise. It couldn't because it's the plain fact of the matter.

    Using the ASCII code won't change anything.

    If you want to prove it to yourself, try:

    NSLog(@"%#x", [@" " characterAtIndex:0]);
    

    It will log "0x20".