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:NSUTF8StringEncoding];
NSLog(@"Decode String Value: %@", decodedString);
In console I continue receiving (null)
, but the data is not null once I insert that code below from return;
. How I can check the type of that NSData stores?