我的问题是,当用户按下登录按钮时,他正在登录您的帐户,然后他选择更新用户配置文件单击所有默认数据已显示并编辑该数据。
我的响应字符串如下所示。
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];
城市,出生日期,性别,用户名显示正确。但是如何使用他们的 id 来显示 statename 和 countryname 呢?我已经在 viewDidLoad 中发送了请求。加载此页面时,用户还可以在该字段上编辑其值。
所以我的问题是在页面加载时显示州名和国家名......