tags:

views:

59

answers:

1

How do I type a square character in Xcode? Not as program code but in a string.

I tried to copy a character but its not working. I am still stuck with:

aCounty.area = @"301.338 km2";
+2  A: 
    const UniChar square = 0x00B2;
    NSString * str = [NSString stringWithFormat:@"%C", square];
    NSLog(@"301 km%@", str);

you can get the character code from OS X's "Special Characters…" menu item

Justin
Or simply `@"301.338 km\u00b2"` if using C99.
mipadi