iphone - asyncSocket writeData crashes with different NSData -


if use set nsdata writedata method crashes.

   nsstring *test = @"the quick brown fox jumped on lazy dog\r\n";    nsdata *data = [test datausingencoding:nsutf8stringencoding];     [asyncsocket writedata:data withtimeout:10 tag:4]; 

however if use 1 works... need nsstring can enter formatted string send...

 char bytes[] = "the quick brown fox jumped on lazy dog\r\n";  nsdata* data = [[nsdata alloc] initwithbytes:bytes length:sizeof(bytes)];   [asyncsocket writedata:data withtimeout:10 tag:4]; 

so did wrong?

the nsstring , nsdate not setup alloc , init gone when got write data. changed nsdate alloc , init , works now. these idea came several people answered this. help!


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -