我的问题是,当用户按下登录按钮时,他会登录您的帐户然后选择更新用户个人资料,然后单击所有默认数据并显示该数据。
我的回复字符串看起来像这样。
Response = {
city = Rajkot;
"country_id" = 88;
dob = "1921-07-12";
gender = M;
"state_id" = 1371;
"user_id" = 22;
username = xyz;
};
我的viewDidLoad代码* *
NSURLResponse *response;
NSData *POSTReply = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:nil];
NSString *theReply = [[NSString alloc] initWithBytes:[POSTReply bytes] length:[POSTReply length] encoding: NSASCIIStringEncoding];
NSLog(@"Reply: %@", theReply);
NSDictionary* dict = [[NSDictionary alloc] initWithObjects:[[NSArray alloc]initWithObjects:userid, nil] forKeys:[[NSArray alloc]initWithObjects:@"Userid", nil]];
NSDictionary* dictMain = [[NSDictionary alloc] initWithObjects:[[NSArray alloc]initWithObjects:@"User",@"getUserProfileDetails",dict,nil] forKeys:[[NSArray alloc]initWithObjects:@"Controller",@"Action",@"Arguments",nil]];
NSString *postString = [NSString stringWithFormat: @"%@",[dictMain JSONRepresentation]] ;
[request setHTTPBody:[postString dataUsingEncoding:NSUTF8StringEncoding]];
[[NSURLConnection alloc] initWithRequest:request delegate:self];
城市,dob,性别,用户名显示正确。但是如何使用他们的id显示statename和countryname? 我已经在viewDidLoad中发送了请求。当此页面加载时,用户还可以在该字段上编辑它们的值。
所以我的问题是在页面加载时显示一个州名和国家名称.....