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

iOS Build a Weather App with Swift (Retired) Displaying Our Weather Data Connecting the UI to Our Model

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

It doesn't refresh it stays the same ? Please help me

I done it all on my own then i tested , it didn't work then i copied his files and changed Api key and location and switch statement tried again still won't work . Please help.

1 Answer

Chris Shaw
Chris Shaw
26,676 Points

Hi Ben,

One thing you need to consider is that the weather data isn't in real time therefore the data you receive from the API is delayed by an X amount of minutes.

If you believe this is an error you can log the contents of your current NSDictionary and check the UNIX timestamp that's returned, if that value is different it means you are getting a fresh JSON response but the data itself hasn't changed.

Ben Holland
Ben Holland
Courses Plus Student 4,062 Points

So does that mean that i need to had the refresh button then it will refresh ?

Chris Shaw
Chris Shaw
26,676 Points

In the next video Pasan explains how to add a refresh button if that was what you were referring to in your original question.

Ben Holland
Ben Holland
Courses Plus Student 4,062 Points

No but could the refresh button make it update ?