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
Post a Comment