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 Objective-C Basics (Retired) Introduction to Objective-C Introducing @property

relevant and unrelevant information.

On the video which shows how to change from conventional C code to objective there are some floating windows with cashed previously copied material and it is distracting. In addition, it would be helpful if there would be a split screen, with conventional code on one side and objective on another.

1 Answer

Denis Kiselev
Denis Kiselev
12,737 Points

Actually you replace C-style program with different one in Objective-C. You replace structs and functions with classes/objects with properties and methods. There is no one-to-one direct analogy! Thou should start thinking of it like new entity - object, that combine some data with some ways of treating this data (methods).

Think of properties as publicly accessible fields of a struct. But properties have big advantage: they allow you to completely control getting values from them and setting values into them by usig getter and setter methods - special code that will handle setting value of property and getting value from property. So, if you have programming control over it, you can use any way of actual storing value of property inside your class. For ex: you can have Person class with FirstName, LastName and FullName properties. You can use strings for storage of FirstName and LastName, but for FullName you can simply calculate it via concatenating FirstName and LastName.