Having troubles with NSInputStream returned value

Discussion in 'iOS Programming' started by CarlosH, May 4, 2009.

  1. CarlosH macrumors member

    Apr 9, 2008
    San Francisco, CA
    So I have this code:

     len = [(NSInputStream *)stream read:buf maxLength:1024];
                    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.


Share This Page