Ios iPhone中的JSON登录

Ios iPhone中的JSON登录,ios,jsonp,Ios,Jsonp,我试图使用PHP Web服务通过JSON进行登录,但问题是,无论何时,它的输出都是未经验证的用户,我能做什么 lementation LoginViewController NSString *username; NSString *password; @synthesize arr,json; - (IBAction)btnLogin:(id)sender { username=txtUserName.text; password=txtPassword.te

我试图使用PHP Web服务通过JSON进行登录,但问题是,无论何时,它的输出都是未经验证的用户,我能做什么

lementation LoginViewController
NSString *username;
NSString *password;
@synthesize arr,json;

- (IBAction)btnLogin:(id)sender {
        username=txtUserName.text;
        password=txtPassword.text;
    NSString *post = [NSString stringWithFormat:@"user_name=%@&user_password=%@",username,password];
        NSLog(@"post data value is:%@",post);
        NSString *hostStr =@"http://myjsonwork.com/working_apps/?";
        hostStr = [hostStr stringByAppendingString:post];


        NSData *dataURL = [NSData dataWithContentsOfURL:[NSURL URLWithString:hostStr]];
        json=[NSJSONSerialization JSONObjectWithData:dataURL options:kNilOptions error:nil];

        NSString *str=[json objectForKey:@"success"];
        NSLog(@"post data value is:%@",hostStr);
        NSLog(@"post dataURL value is:%@",dataURL);


        if ([str isEqualToString:@"True"])
        {
            UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Congrats" message:@"You are //authorised" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil,nil];
        [alert show];

        }
        else
        {
            UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Error" message:@"Invalid Username and password" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil,nil];
            [alert show];
                    }
        }