我已经在viewdidload中设置了所有位置。用户几乎会按一个按钮,标签会显示他们当前的位置(城市)。
错误:使用未解析的标识符'placemark'
func displayLocationInfo(placemark: CLPlacemark) ->String{
self.locationManager.stopUpdatingLocation()
var location:String
location = placemark.locality
println(location)
return location
}
@IBAction func currentLocation(sender: AnyObject) {
originTextField.text = displayLocationInfo(location)
}
答案 0 :(得分:0)
这种方法可以解决您的问题:
public class FoodNeed : BaseNeeds
{
public Dictionary<Type, float> consumptionlist = new Dictionary<Type, float>();
public FoodNeed()
{
consumptionlist.Add (Meat, 0.3f);
}
}