Skip to content

Commit bb590ab

Browse files
Made the exclusion of instance variables more explicit
Fixes kodecocodes#5
1 parent 49fbdd0 commit bb590ab

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Here are some of the documents from Apple that informed the style guide. If some
3131
* [Underscores](#underscores)
3232
* [Methods](#methods)
3333
* [Variables](#variables)
34+
* [Instance Variables](#instance-variables)
3435
* [Property Attributes](#property-attributes)
3536
* [Dot-Notation Syntax](#dot-notation-syntax)
3637
* [Literals](#literals)
@@ -256,7 +257,9 @@ Variables should be named as descriptively as possible. Single letter variable n
256257

257258
Asterisks indicating pointers belong with the variable, e.g., `NSString *text` not `NSString* text` or `NSString * text`, except in the case of constants.
258259

259-
Property definitions should be used in place of naked instance variables whenever possible. Direct instance variable access should be avoided except in initializer methods (`init`, `initWithCoder:`, etc…), `dealloc` methods and within custom setters and getters. For more information on using Accessor Methods in Initializer Methods and dealloc, see [here](https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/MemoryMgmt/Articles/mmPractical.html#//apple_ref/doc/uid/TP40004447-SW6).
260+
### Instance Variables
261+
262+
[Private properties](#private-properties) should be used in place of instance variables whenever possible. Direct access to instance variables that 'back' properties should be avoided except in initializer methods (`init`, `initWithCoder:`, etc…), `dealloc` methods and within custom setters and getters. For more information on using Accessor Methods in Initializer Methods and dealloc, see [here](https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/MemoryMgmt/Articles/mmPractical.html#//apple_ref/doc/uid/TP40004447-SW6).
260263

261264
**Preferred:**
262265

0 commit comments

Comments
 (0)