Snow Leopard problems - [error code]

Discussion in 'Mac Programming' started by amit-battan, Sep 10, 2009.

  1. amit-battan macrumors newbie

    Sep 10, 2009
    Hi All

    In new snow leopard my application not working properly

    crashes in the 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
  2. gnasher729 macrumors P6


    Nov 25, 2005
    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.

Share This Page