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

SWRevealViewController and Core Data

Anybody here that has ever implemented the SWRevealViewController with a Core Data app? My app works fine but I want to check if my code is appropriate.

The managedObjectContext and the managedObjectModel are sent by the appdelegate to the mainviewcontroller, but, now that SWRevealViewController is my rootViewController and has no topViewController, because it takes control of the main flow of the app (I don't understand very well how it works), I guessed that I had to send these two objects to the swrevealviewcontroller and then to the mainviewcontroller.

Is it ok or is there a better way to do it?

Thank you!

1 Answer

Passing MOC and MOM through view controllers is indeed a good way to do it (unless your application is heavily multithreaded).

Thank you very much! It's not multithreaded. I started to learn iOS a week ago, just wanted to confirm that I understood it well for now.