JSON の解析で問題が発生しています。コードを完成させてこれを実行すると、問題が発生します。
セレクター 'show alert:with message' の既知のクラス メソッドはありません。
以下は私のコードです:
if (!isValid) {
[AppDelegate showAlert:@"Alert!" withMessage:strMessage];
}
return isValid;
}
-(void)registerUser{
[Loading startLoading:YES];
NSString *urlString = [NSString stringWithFormat:@"URL=//%@",Access_Token];
//username, password, name, email, country
NSString *parameter = [NSString stringWithFormat:@"firstname=%@&lastname=%@email=%@&username=%@&password=%@&confirmpassword=@",fnameField.text,lnameField.text,eamilField.text,unameField.text,passField.text,cpassField];
NSConnection *conn = [[NSConnection alloc] initWithDelegate:self];
[conn sendRequest:urlString withParaMeter:parameter withMethod:@"POST" withTag:1];
[conn startAsynchronousRequest];
}
-(void)NSConnection:(NSConnection*)conn didFailWithError:(NSError*)error withTag:(int)tag{
NSLog(@"error is:- %@",[error description]);
}
-(void)NSConnection:(NSConnection*)request didSuccessWithItems:(NSDictionary*)dicData withData:(NSData*)data withTag:(int)tag{
NSLog(@"all data is:- %@",dicData);
int returnCode = [[dicData valueForKeyPath:@"process.returncode"] intValue];
NSString *strMessage = @"";
returnCode = 0;
switch (returnCode) {
case 0:
break;
case 1:
strMessage = @"User not logged in/process Id not available.";
break;
case 2:
strMessage = @"Invalid parameters passed.";
break;
case 3:
strMessage = @"Access token doesn't exist.";
break;
default:
strMessage = @"User name allready exist.";
break;
}
[AppDelegate showAlert:@"Alert!" withMessage:strMessage];
[Loading stopLoading];
[self.navigationController popViewControllerAnimated:YES];
私を助けてください。