How to convert a CBPeripheral kCBAdvDataManufacturerData to an NSString iOS

Jump to: navigation, search

NSData *nameData = [advertisementData valueForKey:@"kCBAdvDataLocalName"]; NSString *nameString = [NSString stringWithFormat:@"%@",nameData]; //this works //this does not work // NSString *nameString = [[NSString alloc] initWithData:nameData encoding:NSUTF8StringEncoding]; //the above line did not work even if Encoding type was changed.

See also

Personal tools
Namespaces
Variants
Views
Actions
Navigation