我在线上获得EXC_BAD_ACCESS
:
[asiUsernameRequest startAsynchronous]
;
在此代码中。花了几个小时试图解决它,但没有解决方案。有什么想法吗?
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];
答案 0 :(得分:0)
尝试保留usernameField
的{{1}}:
text