When reading apple generated template code as well as in documentation, I see _ (underscore) and __ (double underscore). Example would be the code generated on checking off core data option:
@synthesize window = _window;
@synthesize managedObjectContext = __managedObjectContext;
@synthesize managedObjectModel = __managedObjectModel;
@synthesize persistentStoreCoordinator = __persistentStoreCoordinator;
What does each of this mean? I understand _ refers to a backing private variable. What does __ mean?
Apple’s documentation suggest NOT to use single underscores in your project (as it reserved by apple itself: best-known example is _cmd ). But underscore is traditional c-style modifier for privateness of identifier, so double underscore is a solution to make private identifier for your variable.
http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CodingGuidelines/Articles/NamingMethods.html