当我发送这些参数时,获取所有参数在字典中为空

时间:2016-01-28 06:13:51

标签: ios iphone

我的注册页面使用mysql获取所有参数在字典中为空,而我发送的那些参数帮我解决了代码错误

NSString *postData = [NSString stringWithFormat:@"email=%@&password=%@&firstName=%@&lastName=%@&dateOfBirth=%@&device_id=%@&latlng=%@&platform=ios",self.emailTextField.text,self.passWordTextField.text,self.firstNameTextField.text,self.lastNameTextField.text,self.dateOfBirthTextField.text,[[NSUserDefaults standardUserDefaults]valueForKey:@"token"],[NSString stringWithFormat:@"%f,%f",latitude,longitude]];

HttpRequest *request = [[HttpRequest alloc] init];
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^
{
    NSDictionary *dictionary = [request makeRequestWithURL:mob_app_signup
                                                       and:postData];

    NSLog(@"user Sign UP dictionary %@",dictionary);
    NSString *message = dictionary[@"message"];
    NSString *success=dictionary[@"success"];
    dispatch_async(dispatch_get_main_queue(), ^{

        [loader removeLoader];
        [self.signUpActionButton setEnabled:YES];
        if (dictionary.count==0)
        {}

        if ([message isEqualToString:@"Signup successfully"] || [success intValue]==1 )
        {
            [[NSUserDefaults standardUserDefaults]setObject:dictionary[@"userid"] forKey:@"userID"];
            [[NSUserDefaults standardUserDefaults]setObject:self.emailTextField.text forKey:@"email"];
            //[[NSUserDefaults standardUserDefaults]setObject:dictionary[@"name"] forKey:@"name"];
            [[NSUserDefaults standardUserDefaults]setObject:self.passWordTextField.text forKey:@"password"];
            [[NSUserDefaults standardUserDefaults]setObject:self.firstNameTextField.text forKey:@"firstName"];
            [[NSUserDefaults standardUserDefaults]setObject:self.lastNameTextField.text forKey:@"lastName"];
            [[NSUserDefaults standardUserDefaults]setObject:self.dateOfBirthTextField.text forKey:@"dateOfBirth"];
            [[NSUserDefaults standardUserDefaults]synchronize];
            //[self performSegueWithIdentifier:@"signUpToVerifyMobile" sender:self];

        [self parseData];

        }

由于

0 个答案:

没有答案