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

Andrew Kelly
Andrew Kelly
4,738 Points

A couple of questions about iOS (and the Ribbit App)

So I'll start off first by asking a quick Ribbit question. I have finished stage 3 but I have noticed that when I de-friend someone or log out and login as a different user the views don't update. I need to re-run the app before I'll see the changes. Everything shows correctly in Parse and I noticed in the videos that these events never occurred. I just wasn't sure if I had done something wrong if its something to learn on my own.

Secondly, I am pretty new to iOS and Objective-C. I have been a OOPHP programmer for years now so a lot of the concepts make a lot of sense, even if the naming conventions throw me off a bit (Methods and functions are essentially the same thing).

The one thing I have been struggling with is the Header file vs. the implementation file.

How come the header file is divided from implementation? To me, it feels like the header file is just included into the implementation file so why wouldn't we just keep everything together. This would allow the source files to be a little easier to navigate.

I'm sure that there is a good reason for it, but I was just wondering why.

The other question I had was also related to header and implementation folders. Is it possible to make folders for Headers and Implementations and drag the files there?

I'm all about being able to navigate folders quickly and at times I start to feel overwhelmed by how busy the folders become. I was just wondering if it's possible to organization without breaking everything.

Thanks so much for your time!

  • Andrew

2 Answers

Brenden Konnagan
Brenden Konnagan
16,858 Points

Great questions!

If you keep going with the Ribbit walk through you will see that the "bug" is corrected with refreshing the views. It does have to do with the view delegate and refreshing a table view.

Second... header files make the code much easier to handle when recycling and reusing code. An object with good design has a header file that makes it very straight forward to implement in your projects. Thus you can call methods and interact with the object through its properties without ever worrying about how the object is implemented.

Third... folder structures in Xcode have no real effect on the build or the actual file structure of the project. As long as the files stay in your project you can arrange files how you would like in Xcode without much concern.

Hope this helps!

Andrew Kelly
Andrew Kelly
4,738 Points

That's great Brenden! Thanks so much! I wasn't sure about the headers but your explanation really helped clear it up.

Also glad to know that if I just continued it'll be fixed. I was going nuts try to find out what I did wrong.

Thanks again!