Check type of class an NSData store?
问题 I have a library that process a string and converts it to an unknown format and insert it into a NSData. In a part of the code that library check if the NSData is empty, if not it sends to the server: if (!dataToSend) { return; } I thought the stored value would be a string or base64, for that tested the following codes: NSLog(@"To string -> %@",[NSString stringWithUTF8String:[dataToSend bytes]]); NSString *decodedString = [[NSString alloc] initWithData:dataToSend encoding