java - How to convert integer to byte in Objective-C -


i have integer value 190. how can convert byte code?

i in java this: a, b, c, d integer values:

somearray[0] = (byte) a; somearray[1] = (byte) b; somearray[2] = (byte) c; somearray[3] = (byte) d; 

if n integer,then can convert byte , add nsmutabledata below.

nsmutabledata *bytedata = [nsmutabledata new]; [bytedata appendbytes:&n length:1]; 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

post - imageshack API cURL -

dataset - MPAndroidchart returning no chart Data available -