Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
iOS Development
Swift Map Annotations and Plist - Help
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="metheone" data-source="post: 1650306" data-attributes="member: 136065"><p>I have now got this, </p><p></p><p>func addAttractionPins() {</p><p> let filePath = NSBundle.mainBundle().pathForResource("LondonPlaces", ofType: "plist")</p><p> let attractions = NSArray(contentsOfFile: filePath!)</p><p> for attraction in attractions! {</p><p> let point = CGPointFromString(attraction["location"] as String)</p><p> let coordinate = CLLocationCoordinate2DMake(CLLocationDegrees(point.x), CLLocationDegrees(point.y))</p><p> let title = attraction["name"] as String</p><p> let annotation = AttractionAnnotation(coordinate: coordinate, title: title)</p><p> myMapView.addannotation(annotation)</p><p> }</p><p> }</p><p></p><p>With the help of an online tutorial, I'm now getting an error on line let annotation...</p></blockquote><p></p>
[QUOTE="metheone, post: 1650306, member: 136065"] I have now got this, func addAttractionPins() { let filePath = NSBundle.mainBundle().pathForResource("LondonPlaces", ofType: "plist") let attractions = NSArray(contentsOfFile: filePath!) for attraction in attractions! { let point = CGPointFromString(attraction["location"] as String) let coordinate = CLLocationCoordinate2DMake(CLLocationDegrees(point.x), CLLocationDegrees(point.y)) let title = attraction["name"] as String let annotation = AttractionAnnotation(coordinate: coordinate, title: title) myMapView.addannotation(annotation) } } With the help of an online tutorial, I'm now getting an error on line let annotation... [/QUOTE]
Verification
Post reply
Forums
macOS & iOS Developer Playground
iOS Development
Swift Map Annotations and Plist - Help
Top