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 Blog Reader iPhone App Data Modeling Using a Custom Class

In what cases should we use Designated & Convenience ?

Actually i have 2 questions:

1- So this app could perfectly run without the designated initialiser or the convenience constructor, ( i just tried it) So why did we use them? and if this app can run without them , are those methods ever be mandatory in any other case ?

2- Why did we save the data we grabbed from the blog in our system ? doesn't that just keep eating memory ?

2 Answers

P M
P M
7,320 Points
  1. If you will use them (call them in your code), they are mandatory. If not - they are not. It's much cleaner to use them than to have lots of nested initialisers all over your code.

  2. If you have no data, how would you display it? Even the web page you're looking at now is saved in your computer's RAM first before it shows on the screen. Same with the data from the blog, first you grab it so you can manipulate it locally, then display it.

Thank You. so using them is just more of an organising thing.