ios - Bad Access/Pointer Issue in Objective-C -
i've got next bit of code:
byte * tokenout = null; (int = 0; < sizeof(tknout); i++) { tokenout[i * 2] = (tknout[i] >> 8); tokenout[(i * 2) + 1] = (tknout[i] & 0xff); }
but generates exc_bad_access error upon running when seek update tokenout. i'd appreciate if tell me i'm doing wrong!
thanks!
you dereferencing null pointer.
try
byte whatever; byte *outtoken = &whatever; // rest.
now there valid memory write to.
except still have issues because write past end of variable. maybe wanted array?
sizeof(outtkn) homecoming 1 (1 byte)
ios objective-c
No comments:
Post a Comment