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
Joseph Lau
5,420 PointsObjective-C: alloc init
I don't really get what alloc and init does. Doug, the instructor, never discusses it in detail, but uses it in his code.
2 Answers
Brett Doffing
4,978 PointsAlloc allocates space in memory for the object (says remember me), while init initializes (creates) the object with initial values.
Rodrigo Chousal
16,009 PointsSorry, I don't understand it enough in order to explain it to you, but I believe Amit explains it later in the course.
Joseph Lau
5,420 PointsJoseph Lau
5,420 PointsI understand the point of init, but what's the point of allocating space in memory?