ivar Decorations

One of the things I did in the process of cleaning up my code was change the name of my instance variables (ivar). I was inspired by an article on the Big Nerd Ranch Weblog. I won’t repeat the whole article here, but the basic idea is that instance variables and properties in Objective-C have different behavior, especially with regards to memory management. Following a naming convention for instance variables gives a reminder that you aren’t dealing with a property. I adopted the convention in the article, and gave each of my instance variables a leading underscore. As an aside, XCode has nice refactoring tools to make variable naming easy.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.