Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

amit-battan

macrumors newbie
Original poster
Sep 10, 2009
16
0
Hi All

In new snow leopard my application not working properly

crashes in the code

Code:
NSError *error;
[NSURLConnection sendSynchronousRequest:theRequest returningResponse:&response error:&error];
NSLog(@"%d",[error code]);

When I comment the [error code] then application works ok please suggest me any good alternative of [error code]

--
Amit Battan
 
Hi All

In new snow leopard my application not working properly

crashes in the code

Code:
NSError *error;
[NSURLConnection sendSynchronousRequest:theRequest returningResponse:&response error:&error];
NSLog(@"%d",[error code]);

When I comment the [error code] then application works ok please suggest me any good alternative of [error code]

Read the documentation of sendSynchronousRequest and take especially note what it says about the error parameter. You might also try setting a breakpoint at the line with the NSLog call and checking what error is. And finally, initializing error to nil as in "NSError* error = nil;" will make the behavior of your code more predictable.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.