I'm trying to convert an NSData object to an NSString using:
or
Both of these return nil using the iOS 5.1 simulator. On iOS 6, they work fine. The data isn't nil. I don't have an iOS 5 device to use for testing, so how can I make sure I'm doing this right? Using Xcode 4.5.1.
Code:
[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
Code:
[NSString stringWithUTF8String:[data bytes]];
Both of these return nil using the iOS 5.1 simulator. On iOS 6, they work fine. The data isn't nil. I don't have an iOS 5 device to use for testing, so how can I make sure I'm doing this right? Using Xcode 4.5.1.