如何根据世界,大陆,州,城市,地区,10英里和50英里的距离查找信息

时间:2020-12-31 19:18:43

i am new developer on iphone i need your help to do my application.i display all received messages on tableview and place a slider on right side in that slider i write some names (world,continent,state,city,region,10miles and 50miles)when selecting any value on the slider (state is selece state wise messages will display) programaticaly how it is possible.

我是iphone的新开发者我需要你的帮助来做我的应用程序。我在tableview上显示所有收到的消息,并在滑块的右侧放置一个滑块我写了一些名字(世界,大陆,州,城市,地区,10英里和50英里)当选择滑块上的任何值时(状态是明确的状态消息将显示)programaticaly如何可能。

1 个解决方案

#1


0  

  1. Don't use a slider, use a segmented control. Sliders are for adjusting a single continously variable value. Have the segments named world,continent,state,city,region,10miles and 50miles.
  2. 不要使用滑块,使用分段控件。滑块用于调整单个连续变量值。有段名为世界,大陆,州,市,区,10英里和50英里。
  3. Before displaying the messages, loop through them and set up an array of the messages for each of the options.
  4. 在显示消息之前,循环显示消息并为每个选项设置消息数组。
  5. Link the segmented control to an IBAction in your view controller. When it gets called, call reloadData on the table view which shows your list of messages.
  6. 将分段控件链接到视图控制器中的IBAction。调用它时,在表视图上调用reloadData,显示消息列表。
  7. In your cellForRowAtIndexPath method, use a case structure to select the array from which to assign the text on the cell depending on the value of segmentedControl.selectedSegmentIndex
  8. 在您的cellForRowAtIndexPath方法中,使用案例结构选择要从中分配文本的数组,具体取决于segmentedControl.selectedSegmentIndex的值

#1


0  

  1. Don't use a slider, use a segmented control. Sliders are for adjusting a single continously variable value. Have the segments named world,continent,state,city,region,10miles and 50miles.
  2. 不要使用滑块,使用分段控件。滑块用于调整单个连续变量值。有段名为世界,大陆,州,市,区,10英里和50英里。
  3. Before displaying the messages, loop through them and set up an array of the messages for each of the options.
  4. 在显示消息之前,循环显示消息并为每个选项设置消息数组。
  5. Link the segmented control to an IBAction in your view controller. When it gets called, call reloadData on the table view which shows your list of messages.
  6. 将分段控件链接到视图控制器中的IBAction。调用它时,在表视图上调用reloadData,显示消息列表。
  7. In your cellForRowAtIndexPath method, use a case structure to select the array from which to assign the text on the cell depending on the value of segmentedControl.selectedSegmentIndex
  8. 在您的cellForRowAtIndexPath方法中,使用案例结构选择要从中分配文本的数组,具体取决于segmentedControl.selectedSegmentIndex的值