写的是一个类似商城的app,加入购物车的按钮点击事件,把商品信息加入服务器的数据库;我点购物车的时候,用
NSString *shopBoxStr=[[NSString alloc]initWithFormat:@"http://127.0.0.1:50000/shopBox?"];
NSLog(@"urlstr=[%@]",shopBoxStr);
NSURL *taburl=[[NSURL alloc]initWithString:shopBoxStr];
NSURLRequest *tabrequest=[[NSURLRequest alloc]initWithURL:taburl];
[NSURLConnection sendSynchronousRequest:tabrequest returningResponse:nil error:nil];
向服务器请求,服务器会查询数据库,但是我不知道怎么将数据库里面的东西传给客户端,服务器是用c语言写的
NSString *shopBoxStr=[[NSString alloc]initWithFormat:@"http://127.0.0.1:50000/shopBox?"];
NSLog(@"urlstr=[%@]",shopBoxStr);
NSURL *taburl=[[NSURL alloc]initWithString:shopBoxStr];
NSURLRequest *tabrequest=[[NSURLRequest alloc]initWithURL:taburl];
[NSURLConnection sendSynchronousRequest:tabrequest returningResponse:nil error:nil];
向服务器请求,服务器会查询数据库,但是我不知道怎么将数据库里面的东西传给客户端,服务器是用c语言写的
2.如果你C可以的话自己写,我可以给你看一个示例,不知道对你有没有用; Method_INIT("createCompany_02", g_serverList_cloud, config.server_port_cloud);
CreateCompanyRequest_02 req;
req.userId = g_userState.userId;
req.token = g_userState.token;
req.companyName = companyName;
req.taxNumber = taxNumber;
req.terminalType = terminalType;
RequestServer(CreateCompanyRequest_02, CreateCompanyResponse_02);
heart_01(5, true); description = res.description;
return_back(res.result);我觉得你最好让服务端开发人员给你写一个,然后你用C和OC混编
php json 爽的一匹