Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android

Ben Holland
PLUS
Ben Holland
Courses Plus Student 4,062 Points

How do i fix this problem ? In the comments on the github repo

Heres the gitub repo : https://github.com/benhollandY0ung/Weatherly-iOS Pasan Premaratne would you know whats wrong with my location code ? Im using Corelocation and i get an error in line 70 about var currentLocation = CLLocation!

2 Answers

Pasan Premaratne
STAFF
Pasan Premaratne
Treehouse Teacher

Do you have a descriptive string in your Info.plist file? Check the "Descriptive String" section of this post

Pasan Premaratne
Pasan Premaratne
Treehouse Teacher
var currentLocation = CLLocation!

You're force unwrapping a class here. That doesn't do anything because the class isn't an optional. You need to allocate and initialize the class.

var currentLocation = CLLocation()

This should get rid of that error but I haven't looked at anything else to see if your location code works since you're using a 3rd party library.

Ben Holland
PLUS
Ben Holland
Courses Plus Student 4,062 Points

If i remove OneShotLcationManager and everything related could you i this with only CoreLocation?