In Google’s Objective-C Style guide which is follow by many people , Google says
Class member variables have trailing
underscores
Why? Is there any good reason for doing this? I found apple usually name an ivar when beginning underscore.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Heavy users of Core Data will have also noticed that Core Data attributes cannot begin with non-alpha characters. If you want to name ivars consistently across your app and various projects, this is another reason to append, rather than prepend, your ivars with an underscore.
If you’re not using Core Data a lot, or you don’t have OCD tendencies towards consistency in naming conventions, then whatever works best for you is probably the right answer.