Convert “String” of Binary to NSString of text
问题 I am able to convert an NSString of (ASCII) text to a NSString of binary numbers, but I am having troubles doing the opposite. For example: "Hi" becomes "01101000 01101001". I need: "01101000 01101001" to become "Hi". I'm looking for the most direct way to implement this. Note the space between every 8 bits of binary numbers. 回答1: Considering the format is always like that, this code should work: NSString * BinaryToAsciiString (NSString *string) { NSMutableString *result = [NSMutableString