简体   繁体   中英

how to print infinity symbol in objective-c

I need to set an NSString with infinity symbol '∞' and print it onto the screen. I don't know how to make it. Hope you guys could help.

你可以使用NSString *infinity = @"\∞";

您可以使用:

[NSString stringWithFormat:@"%C", 0x221E];

You can get the ASCII code and then create an NSString object.

Something like this:

int code = 236; //I believe this is the code you are looking for.
NSString *string = [NSString stringWithFormat:@"%c", code];

I hope this helps you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM