EXC_BAD_ACCESS on startAsynchronous request using ASIFormDataRequest

Posted by user280556 on Stack Overflow See other posts from Stack Overflow or by user280556
Published on 2010-03-16T11:22:06Z Indexed on 2010/03/16 11:26 UTC
Read the original article Hit count: 356

I am getting EXC_BAD_ACCESS on the Line:

[asiUsernameRequest startAsynchronous];

in this code. Spent hours trying to figure it out, but no solution. Any idea?

    NSString *usernameValue = (NSString*)usernameField.text;
    NSLog(@"username selected: %@", usernameValue);

    NSURL *url = [NSURL URLWithString:@"http://www.mywebsite.com/api/usernameCheck"];
    //ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
    asiUsernameRequest = [[[ASIFormDataRequest alloc] initWithURL:url] retain];
    [asiUsernameRequest setPostValue:usernameValue forKey:@"username"];
    NSArray *objects = [NSArray arrayWithObjects:@"usernameCheck", nil];
    NSArray *keys = [NSArray arrayWithObjects:@"action", nil];
    asiUsernameRequest.userInfo = [NSDictionary dictionaryWithObjects:objects forKeys:keys];
    [asiUsernameRequest setDelegate:self];
    [asiUsernameRequest startAsynchronous];

© Stack Overflow or respective owner

Related posts about exc-bad-access

Related posts about asynchronous