I'm trying to get objects out of a plist and use them in Swift to create a CLCircularRegion, but when I try and use those values I see this error
Cannot invoke 'init' with an argument list of type '(center: $T3, radius: @lvalue AnyObject?!, identifier: @lvalue AnyObject?!)'
Here's the method I'm using to pull the data from the plist, which works fine as I can see the content via the println call.
func setupLocations() {
// Region plist
let regionArray = NSArray(contentsOfFile: NSBundle.mainBundle().pathForResource("Landmarks", ofType: "plist")!)
println(regionArray)
for location in regionArray! {
var longitudeNumber = location["Longitude"]
var latitudeNumber = location["Latitude"]
var rangeNumber = location["Range"]
var regionString = location["Identifier"]
let newRegion = CLCircularRegion(center: CLLocationCoordinate2DMake(latitudeNumber, longitudeNumber), radius: rangeNumber, identifier: regionString)
}
}
Within the plist the objects are stored as an array, which contains a dictionary. That dictionary contains three Number values and one String value.