UIWebView 的位置 - iPhone
我想知道是否可以将一个人的位置的经纬度发送到 URL?它还需要其 UDID 编号与数据库相匹配。
这是我到目前为止所拥有的:
-(void)viewDidLoad {
NSString *query = [[NSString alloc] initWithFormat:
@"http://example.com/ihome.php?uid=%@",
[[UIDevice currentDevice] uniqueIdentifier],
@"&year=2010%@"];
NSURL *url = [[NSURL alloc] initWithString:query];
NSURLRequest *requestObj = [ NSURLRequest requestWithURL: url ];
webView.opaque = NO;
webView.backgroundColor = [UIColor clearColor];
[webView loadRequest: requestObj ];
}
I am wondering if there is away to send the lat and long of a person's location to a URL? It would also need to have their UDID number to match with the database.
Here is what I have so far:
-(void)viewDidLoad {
NSString *query = [[NSString alloc] initWithFormat:
@"http://example.com/ihome.php?uid=%@",
[[UIDevice currentDevice] uniqueIdentifier],
@"&year=2010%@"];
NSURL *url = [[NSURL alloc] initWithString:query];
NSURLRequest *requestObj = [ NSURLRequest requestWithURL: url ];
webView.opaque = NO;
webView.backgroundColor = [UIColor clearColor];
[webView loadRequest: requestObj ];
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在请求 URL 之前,您必须计算经度和纬度。
You have to calculate the longitude and the latitude before to request the URL.