PDA

View Full Version : Having troubles with NSInputStream returned value




CarlosH
May 4, 2009, 10:58 AM
So I have this code:

len = [(NSInputStream *)stream read:buf maxLength:1024];
if(len)
{
NSString *tmpStr = [[NSString alloc] initWithBytes:buf length:len encoding:NSUTF8StringEncoding];
}



But len is returning a very big number, like 4294967295, and I am getting a exec_bad_access error when trying to create the string. Anyone have had any issues with this class? This was working before, but I was using iPhone SDK 2.0, but when compiling to 2.2.1, now I get this error, tried to compile for 2.0 again, but the error persist, is like I am still using the 2.2.1 libraries.

Thanks.