objective c - NSString to NSData conversion to Hex Value -
this question has answer here: converting hex nsstring nsdata 4 answers i've been trying convert user defaults nsstring (tried nsdata also), hex value can use char array. problem every time convert nsstring or nsdata takes hex values , turns them ascii values, isn't want @ all. how tell literally take values there , keep them hex? i'm struggling find solution. inside .plist <key>shit</key> <string>5448495344414e475448494e474e45454453544f53544159484558</string> my code convert nsstring nsdata nsstring *defaults = [[nsuserdefaults standarduserdefaults] objectforkey:@"shit"]; nsdata *thedata = [defaults datausingencoding:nsutf8stringencoding]; nsuinteger datalength = [thedata length]; byte *bytedata = (byte*)malloc(datalength); memcpy(bytedata, [thedata bytes], len); nslog(@"this : %@",[n...