如何在 iPhone 中的 URL 中传递 PickerValue
arrayNo = [[NSMutableArray alloc] init]; //pickerview radius array
//[arrayNo addObject:@" Radius "];
[arrayNo addObject:@" 10 "];
[arrayNo addObject:@" 15000 "];
[arrayNo addObject:@" 20000 "];
[pickerView selectRow:1 inComponent:0 animated:NO];
[addressField resignFirstResponder];
radius.text= [arrayNo objectAtIndex:[pickerView selectedRowInComponent:0]];
我想在半径处的以下网址中传递上述半径选择器,
NSString *url = [NSString stringWithFormat:@"http://.............../phpsqlsearch_genxml.php?lat=%f&lng=%f&radius=%f",lati,longi,radius];
我尝试在按钮单击事件上使用以下代码,但不起作用。
NSString * radius = [[[NSString alloc] initWithFormat:@"%f",[arrayNo objectAtIndex:[pickerView selectedRowInComponent:0]]]autorelease];
我应该为此编写什么代码......提前致谢
arrayNo = [[NSMutableArray alloc] init]; //pickerview radius array
//[arrayNo addObject:@" Radius "];
[arrayNo addObject:@" 10 "];
[arrayNo addObject:@" 15000 "];
[arrayNo addObject:@" 20000 "];
[pickerView selectRow:1 inComponent:0 animated:NO];
[addressField resignFirstResponder];
radius.text= [arrayNo objectAtIndex:[pickerView selectedRowInComponent:0]];
I want to pass the above radius picker in following url at radius
NSString *url = [NSString stringWithFormat:@"http://.............../phpsqlsearch_genxml.php?lat=%f&lng=%f&radius=%f",lati,longi,radius];
I tried with following code on button click event but not working.
NSString * radius = [[[NSString alloc] initWithFormat:@"%f",[arrayNo objectAtIndex:[pickerView selectedRowInComponent:0]]]autorelease];
What code should I write for the same...thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以将代码更改为,
并且,您不需要最后一行
NSString * radius = ...
。You can change your code to,
And, you don't need the last line
NSString * radius = ...
.